Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / What file to edit Header?

What file to edit Header?

Views: 506

Results 1 to 6 of 6
15 Feb 2011, 9:15 AM
#1
kloberemt avatar

kloberemt

New Zenner

Join Date:
Feb 2011
Posts:
3
Plugin Contributions:
0

What file to edit Header?

I have recently added a forum to my site and want to include a link on the top of the Zencart header. Currently there is "Home" and "Login" at the top. I simply want to add "Forum" along side these links at the top. How can I add this: what file and where is it located? Thanks in advance?

15 Feb 2011, 9:37 AM
#2
kobra avatar

kobra

Black Belt

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

Re: What file to edit Header?

Actually once logged in there are several other links that appear on that line
I would make your forum link last

In a copy for your template structure (override) of tpl_header.php

15 Feb 2011, 10:12 AM
#3
kloberemt avatar

kloberemt

New Zenner

Join Date:
Feb 2011
Posts:
3
Plugin Contributions:
0

Re: What file to edit Header?

Thanks. I have found the file. What is the appropiate method to insert my forum link at the end without causing errors? Sample code would be appreciated.

<?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>
15 Feb 2011, 10:34 AM
#4
kobra avatar

kobra

Black Belt

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

Re: What file to edit Header?

Try this, using a code editor insert the red highlighted code correcting for your details

<div id="navMain">
    <ul class="back">
    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?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 }?>
    li><a href="http://your_domain.com/your_forum" rel="nofollow">My Forum</a></li>
</ul>
</div>
15 Feb 2011, 8:39 PM
#5
kloberemt avatar

kloberemt

New Zenner

Join Date:
Feb 2011
Posts:
3
Plugin Contributions:
0

Re: What file to edit Header?

Thanks for the help, that worked. One more question for you please. What file should I post my Google Analytics code into? /includes/languages/english/index.php? Thanks agaiin

16 Feb 2011, 5:09 AM
#6
kobra avatar

kobra

Black Belt

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

Re: What file to edit Header?

Can be added to tpl_footer.php