At the top of the Index page there is a task bar that shows "Home" and "Log In".
How/where can I go to add a link before the word "Home". Which file, please. Thanks.
At the top of the Index page there is a task bar that shows "Home" and "Log In".
How/where can I go to add a link before the word "Home". Which file, please. Thanks.
Its inside /includes/your-template/common/tpl_header.php
you can add link inside the navMain div box line 44 (before the Home link);
Just be sure that not to add too may links, otherwise the div box will explode.PHP Code:<div id="navMainWrapper">
<div id="navMain">
<ul class="back">
<li> insert your link here </li>
...
Wellll, I tried to add the code and it didn't work, so I tried to undo it, and now my index page is all messed up.
I believe I need a new copy of common/tpl_header.php sent to me.
Can someone attach this file to a Private Message to me, please? thanks.
Or give me a suggestion.
Take the file from the original installation
How did you add the code, it should be inside php syntax,
example:
link to internal page, example 'Specials' page:
link to external page, example 'Google':PHP Code:<li><a href="<?php echo zen_href_link('specials')?>">Specials</a></li>
Make sure you always create 'override' template folder and files when you work on any template files modification, so that if something goes wrong, you just remove the 'override' files and the original file at work again.PHP Code:<li><a href="<?php echo 'http://www.google.com'?>">Google</a></li>
By this method no matter how you do the modification and make 'mistakes' you have nothing to worry about. The original files still safe, leave it untouch.
Check here for first step in customizing your site
http://www.zen-cart.com/forum/showthread.php?t=36567
Thank you for your assistance. However, I have several questions.
First of all you stated it's inside
" /includes/your-template/common/tpl_header.php".
I have classicx template. I only see the common file at
" /includes/classic/common/tpl_header.php
Are you saying I should have
"/includes/classicx/common/tpl_header.php" ?
Because I don't have that.
If I should have that , how do I add it?
Secondly, you stated "you can add link inside the navMain div box line 44 (before the Home link)" and then you show this:
<div id="navMainWrapper">
<div id="navMain">
<ul class="back">
<li> insert your link here </li>
...
Are you showing me all the code I need to add? Or are you showing me what line 44 show look like and I just add <li>insert link here</li> ?
Because line 44 in the tpl_header.php file looks like this:
<td align="right" valign="top" width="35%" class="headerNavigation">
You stated "(before the Home link)". I don't see the Home link.
Should I add the following code:
"<div id="navMainWrapper">
<div id="navMain">
<ul class="back">
<li> insert your link here </li>
... "
after this line:
<td align="right" valign="top" width="35%" class="headerNavigation"> ?
I appreciate your assistance, but it really wasn't that clear to me.
Thanks in advance for your reply and clarification.
Copy tpl_header.php from /template_default/common/ to /classicx/common/ .
Line numbers are often unreliable; your link code should go on a new line after the "<ul class="back">":
("HEADER_TITLE_CATALOG" will dsiplay in your site header as "Home" or whatever you set it to.)PHP Code:<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
<ul class="back">
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?>
and follow instructions above on php coding.PHP Code:<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
<ul class="back">
<li>your code</li>
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?>
First of all you need to create an 'override' folder and files, so leave the folder /classic/ or /template_default/ untouch. The basic of work is better from /template_default/ not from /classic/
Step 1:
Create a brand new folder example -> /mytemplate/
so there will be new folder at /includes/templates/mytemplate/
Step 2:
Create its subfolders such as -> mytemplate/common/
mytemplate/css/ and mytemplate/images/
these subfolders are the clone of the original subfolders from /template_default/
Step 3:
copy all the files that you want to change from /template_default/, in this case tpl_header.php from /template_default/common/tpl_header.php to /mytemplate/common/tpl_header.php
Those step above are basic step in creating override folder & files, it applies to every files that you want to CHANGE, just grab the copy from /template_default/ and paste it in /mytemplate/, and start work on that copied files. No need to copy file that you dont want to change.
By this method you leave the original files untouch and ZenCart will detect any override files and process it instead.
Now you can work on the files you just copied, inthis case -> tpl_header.php from the brand new folder /mytemplate/common/
If you copy correctly from /template_default/ you will see tpl_header.php line 44 will start like below, I copy the entire Header Navigation Div box and insert the 'specials' link that we want to put there.
If you see below the 'special' link that we just inserted, there is HEADER_TITLE_CATALOG which means 'Home'PHP Code:<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
<ul class="back">
<li><a href="<?php echo zen_href_link('specials')?>">Specials</a></li>
<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>
<div class="navMainSearch forward"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
</div>
So in your header will look something like this
Special Home Login
'specials' menas it will link to this page:
If you want to change the link 'special' to another page/products, simply mouseover or go to any page and see the link that pointed there in your browser address,HTML Code:http://www.yourdomain.com/index.php?main_page=specials
example the privacy page:
so you can replace toHTML Code:http://www.yourdomain.com/index.php?main_page=privacyto make link to Privacy page for an example.PHP Code:<li><a href="<?php echo zen_href_link('privacy')?>">Privacy</a></li>
Hope this helps, please update your progress
Last edited by milkyway; 29 Aug 2006 at 05:00 PM.
WARNING !!!!
when you copy/paste links from your cart please remember that if the link contains the zenid to NOT paste it into your new code.
If you use a URL with a zenid= into a hard coded link you are going to have a TON of pissed customers with lots of errors in your orders such as customer orders sent to the wrong account - logins going to the wrong accounts, etc.
When the world gets in my face I say Have A Nice Day.
* I DO Think and I HAVE BEEN Zenned - therefore, I AM * I donate - do you?
Custom Templates and Zen Services CRS Designs, Inc.
Thanks so much for taking the time to assist me. Really appreciate the clarification.
I created a new template folder and sub-folder common, and copied tpl_header.php into it.
However, when I added <li><a href="<?php echo 'http://www.mywebhomepage.com'?>">Home</a></li>
and Refreshed the main Zen page, it didn't appear. So I added that line to template_default and now it appears. I don't know why, but I've accomplished what I set out to do.
Thanks again.