How to add links to header bar without ez-pages
I saw many people asked about this and the files where archieved, i really didn't see a clear answer to their questions on how to add a link to the header bar. I may have missed this for give me. But i thought i'll explain how i did it without using ez-pages.
Two files need to be looked at includes/template/your template/tpl_header.php
in this file look for:
<table border="0" cellspacing="0" cellpadding="0" class="headerNavigation" align="center">
<tr class="headerNavigation">
<td align="left" valign="top" width="80%" class="headerNavigation">
<a href="<?php echo zen_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CATALOG; ?></a> |
This should be around line 67 - 70,
right after the last " | "
add your links, which should look somthing like this:
<a href="<?php echo zen_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CATALOG; ?></a> |
<!--Extra links-->
<a href="<?php echo zen_href_link(FILENAME_PRODUCTS_ALL); ?>"><?php echo BOX_HEADING_PRODUCTS_ALL; ?></a> |
<a href="<?php echo zen_href_link(FILENAME_SPECIALS); ?>"><?php echo BOX_HEADING_SPECIALS; ?></a> |
<a href="<?php echo zen_href_link(FILENAME_PRODUCTS_NEW); ?>"><?php echo BOX_HEADING_WHATS_NEW; ?></a> |
<a href="<?php echo zen_href_link(FILENAME_FEATURED_PRODUCTS); ?>"><?php echo BOX_HEADING_FEATURED_PRODUCTS; ?></a> |
<a href="<?php echo zen_href_link(FILENAME_CONTACT_US); ?>"><?php echo BOX_INFORMATION_CONTACT; ?></a> |
Now the second file should be your includes/languages/your languae/your template/english.php.
you need to make sure your heading in your english file matched the one you wish to use. In this case i use "BOX_HEADING_FEATURED_PRODUCTS" this will display the text for the heading in the english file. "Featured products"
Test it out see how the links display on your header bar you may need to adjust the table so the text align correctly.
You can see the results on my page www.lextechs.com
I hope this helps out and i have not stepped on anyone toes. I just thougth i'd help a bit or make it a bit easier for others to find in the further.
Thanks
Lextechs
Re: How to add links to header bar without ez-pages
Very helpful ... :smile:
Note: your configure.php files are setup for:
lextechs.com
Your secure certificate is issued to:
www.lextechs.com
Your are throwing errors because of this ... :cry:
Re: How to add links to header bar without ez-pages
Were these links added to Zen Cart 1.3.5? Because I don't see anything like this:
<table border="0" cellspacing="0" cellpadding="0" class="headerNavigation" align="center">
<tr class="headerNavigation">
<td align="left" valign="top" width="80%" class="headerNavigation">
<a href="<?php echo zen_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CATALOG; ?></a> |
in includes/template/your template/tpl_header.php for 1.3.5.
I am trying to add a single link in the header bar called "Site Map" to link to
http://www.holymtn.com/sitemap.htm
so that our clients can access the rest of our site from the Zen Cart catalog folder without having to use their "Back" buttons. We have thousands of pages on our original site and it may take years (if ever) for us to incorporate all our content into the Zen Cart matrix. Our current plan is for the catalog only to run on Zen Cart, therefore we need a link to our original site map in the navigation bar.
Re: How to add links to header bar without ez-pages
ooh i have to try this. i was trying to use an image map to add some links on the header that would change depending on the language selected. this might be my solution.
Re: How to add links to header bar without ez-pages
For v1.3.5 look in includes -> templates -> YOUR_TEMPLATE -> common -> tpl_header.php
find this code:
PHP Code:
<div id="navMain">
<ul class="back">
<li><?php echo '<a href="' . zen_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<li><a href="http://www.holymtn.com/sitemap.htm">Site Map</a></li>
add your link as indicated.
Re: How to add links to header bar without ez-pages
many thanks to lextechs!
I now know how to add links with php.
this was exactly what I needed and I was able to implement a nav bar under the header image with links to my MORE INFO pages!
Now I can forget about that image map I couldn't get to work. hehe
Re: How to add links to header bar without ez-pages
That worked beautifully, clydejones. Thank you very much!
Re: How to add links to header bar without ez-pages
As seen above use the pipeline | as separator with the code,
|
Suggest change it to as below, if for validation. Otherwise there will have two kinds of warnings about the pipeline and the li.
Suggested code for v1.3.5:
<li id=navMainMySeparator> & #124;</li>
Please note,
the code
& #124;
which should without any space.
I separated it for the forum show it as pipe line instead of the code.
And the html code equivalent to the pipeline display.
The added <li> ..</li> also for validation. And the added id navMainMySeparator may not needed.
Reference: 1.3.5 - Home | Login separator not visible
.
Re: How to add links to header bar without ez-pages
FYI, the code on the first post is from a previous version of Zen Cart.
For the latest version you wont see the table tag.
The code below is the code for the top bar where you see HOME-LOGIN-MYACCOUNT etc etc.
Code:
<div id="navMainWrapper">
<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 }?>
</ul>
</div>
WOOPS! clyde already posted this. hehe.
Re: How to add links to header bar without ez-pages
great stuff this thanks it worked a treat :thumbsup:
just 1 question though how can i center the links on the bar???