Forums / Templates, Stylesheets, Page Layout / Which FILE to modify ?

Which FILE to modify ?

Views: 1,385

Results 1 to 13 of 13
06 Apr 2011, 18:06
#1
website_editor avatar

website_editor

New Zenner

Join Date:
Apr 2011
Posts:
5
Plugin Contributions:
0

Which FILE to modify ?

I am completely new to Zen cart. I am editing one of my client's website to reflect navigation and phone number changes. 3 of his pages are created using Zen cart which DOES NOT have header and footer through Zen cart interface but it has this customized navigation bar as header and footer which is same as the entire website.

My question is which files do I edit to reflect the header and footer changes on Zen cart pages and where to locate those files ?

06 Apr 2011, 18:34
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
6

Re: Which FILE to modify ?

They should be /includes/templates/your_template/common/tpl_header.php and tpl_footer.php, where your_template is the foldername of the active custom template. As this is apparently a highly modified installation, it could be something else entirely; we would have to see the file structure to be sure.

Use FTP to access the Zen Cart installation, download the files, edit and re-upload them. Note: you cannot use Word to edit these files, as it will add extra formatting and junk that will damage the files. Use a good text/file editor like Notepad++.

06 Apr 2011, 18:35
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Which FILE to modify ?

Where is the site?

url to a page in the cart and one to other page

06 Apr 2011, 18:52
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Which FILE to modify ?

gjh42 pointed you to the files and the overrides(do not edit core files) edited copies will be in your template structure includes/templates/circos/common/ for those 2 files

You are half in ZenCart and half outside the html pages are no longer needed - just move content to ZenCart and move ZenCart from "/store" to "/"

06 Apr 2011, 19:06
#6
website_editor avatar

website_editor

New Zenner

Join Date:
Apr 2011
Posts:
5
Plugin Contributions:
0

Re: Which FILE to modify ?

I looked for the tpl_header.php and tpl_footer.php in includes/templates/circos/common/ I am not too sure what to edit in those files as I couldn't find any HTML code.

You are correct by saying that the pages are half HTML and half Zen cart. I appreciate your advice of moving it completely to Zen Cart. But it would be much more benficial as of now.. to just modify the navigation and phone number. Can you help me figure out the HTML / PHP pages that would have header and footer that I need to modify ?

06 Apr 2011, 19:07
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
6

Re: Which FILE to modify ?

Perhaps due to the acrobatics of trying to have a site which is half HTML and half Zen Cart, you have some serious HTML errors: http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.circospastryshop.com%2Fstore%2Findex.php%3Fmain_page%3Dpage%26id%3D2 Some of these are trivial, but some really need to be corrected before you can expect your site to work right in all browsers.

06 Apr 2011, 19:10
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
6

Re: Which FILE to modify ?

The HTML is built in bits and pieces in those files, unless the template creator put it all somewhere else. If you post the tpl_header.php between ``` [php] and [/php]

06 Apr 2011, 19:16
#9
website_editor avatar

website_editor

New Zenner

Join Date:
Apr 2011
Posts:
5
Plugin Contributions:
0

Re: Which FILE to modify ?

<?php
/**
 * Common Template - tpl_header.php
 *
 * this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * make a directory /templates/my_template/privacy<br />
 * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
 * to override the global settings and turn off the footer un-comment the following line:<br />
 * <br />
 * $flag_disable_header = true;<br />
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
 */
?>

<?php
  // Display all header alerts via messageStack:
  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
  if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
  echo htmlspecialchars(urldecode($_GET['error_message']));
  }
  if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
   echo htmlspecialchars($_GET['info_message']);
} else {

}
?>


<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>

<div id="headerWrapper">
<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
    <ul class="back">
    <li><?php echo '<a href="">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<?php if ($_SESSION['customer_id']) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php
      } else {
        if (STORE_STATUS == '0') {
?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?>

<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
</ul>
</div>
<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
</div>
<!--eof-navigation display-->

<!--bof-branding display-->
<div id="logoWrapper">
<table border="0">
<tr><td id="logoCell" height="98" colspan="6"></td></tr>
<tr>
	<td> </td>
	<td> </td>
	<td> </td>
	<td> </td>
	<td> </td>
	<td> </td>
</tr>
</table>

<!-- <a href="../" style="display:block;width:100%;height:100%"> -->
    <!--<div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>-->
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
    <div id="taglineWrapper">
<?php
              if (HEADER_SALES_TEXT != '') {
?>
      <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
<?php
              }
?>
<?php
              if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                if ($banner->RecordCount() > 0) {
?>
      <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php
                }
              }
?>
</a>    </div>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
</div>
<br class="clearBoth" />
<!--eof-branding display-->

<!--eof-header logo and navigation display-->

<!--bof-optional categories tabs navigation display-->
<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
<!--eof-optional categories tabs navigation display-->

<!--bof-header ezpage links-->
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<?php } ?>
<!--eof-header ezpage links-->
</div>
<?php } ?>
06 Apr 2011, 19:31
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
6

Re: Which FILE to modify ?

The first thing your copy of tpl_header.php does (after displaying any warnings or alerts) is to add an HTML comment

<!--bof-header logo and navigation display-->

even before deciding whether to output the header. This is absent from the output. It appears your /includes/templates/circos/common/tpl_main_page.php may have been hacked up to delete the call to the header entirely.

06 Apr 2011, 19:35
#11
website_editor avatar

website_editor

New Zenner

Join Date:
Apr 2011
Posts:
5
Plugin Contributions:
0

Re: Which FILE to modify ?

Hey.. I got that .. its the tpl_main_page.php that has this HTML header and footer which I CAN edit.. Thank You so much for all yor help.. Greatly appreciate it :)

06 Apr 2011, 19:40
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
6

Re: Which FILE to modify ?

Note that the modification to the file structure means that there is no way for error messages or alerts to be displayed to the customer now. If you want to completely substitute your own header code, fine, but you need to keep the require for tpl_header.php so that system can function. You can turn the header off by making a switch in tpl_main_page.php, as described in that file.

07 Apr 2011, 12:14
#13
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Which FILE to modify ?

post #4