Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Aug 2006
    Posts
    104
    Plugin Contributions
    0

    Default Adding a link to the task bar

    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.

  2. #2
    Join Date
    Aug 2006
    Location
    Singapore
    Posts
    167
    Plugin Contributions
    1

    Default Re: Adding a link to the task bar

    Its inside /includes/your-template/common/tpl_header.php

    you can add link inside the navMain div box line 44 (before the Home link);

    PHP Code:
    <div id="navMainWrapper">
    <
    div id="navMain">
        <
    ul class="back">
        <
    liinsert your link here </li>
        ... 
    Just be sure that not to add too may links, otherwise the div box will explode.

  3. #3
    Join Date
    Aug 2006
    Posts
    104
    Plugin Contributions
    0

    Default Re: Adding a link to the task bar

    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.

  4. #4
    Join Date
    Aug 2006
    Posts
    20
    Plugin Contributions
    0

    Default Re: Adding a link to the task bar

    Take the file from the original installation

  5. #5
    Join Date
    Aug 2006
    Location
    Singapore
    Posts
    167
    Plugin Contributions
    1

    Default Re: Adding a link to the task bar

    How did you add the code, it should be inside php syntax,

    example:

    link to internal page, example 'Specials' page:

    PHP Code:
    <li><a href="<?php echo zen_href_link('specials')?>">Specials</a></li>
    link to external page, example 'Google':

    PHP Code:
    <li><a href="<?php echo 'http://www.google.com'?>">Google</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.

    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

  6. #6
    Join Date
    Aug 2006
    Posts
    104
    Plugin Contributions
    0

    Default Re: Adding a link to the task bar

    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.

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding a link to the task bar

    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">":
    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?>
    ("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>your code</li>
        <li><?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">'?><?php echo HEADER_TITLE_CATALOG?>
    and follow instructions above on php coding.

  8. #8
    Join Date
    Aug 2006
    Location
    Singapore
    Posts
    167
    Plugin Contributions
    1

    Default Re: Adding a link to the task bar

    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.

    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>
    If you see below the 'special' link that we just inserted, there is HEADER_TITLE_CATALOG which means 'Home'

    So in your header will look something like this

    Special Home Login

    'specials' menas it will link to this page:

    HTML Code:
    http://www.yourdomain.com/index.php?main_page=specials
    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,

    example the privacy page:

    HTML Code:
    http://www.yourdomain.com/index.php?main_page=privacy
    so you can replace to
    PHP Code:
    <li><a href="<?php echo zen_href_link('privacy')?>">Privacy</a></li>
    to make link to Privacy page for an example.

    Hope this helps, please update your progress
    Last edited by milkyway; 29 Aug 2006 at 05:00 PM.

  9. #9
    Join Date
    Jan 2005
    Location
    Lake Havasu, AZ
    Posts
    1,149
    Plugin Contributions
    0

    Re: Adding a link to the task bar

    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.

  10. #10
    Join Date
    Aug 2006
    Posts
    104
    Plugin Contributions
    0

    Default Re: Adding a link to the task bar

    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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Adding new link to Information bar
    By Arkangil in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 5 Aug 2009, 12:55 PM
  2. adding custom link bar to products page
    By shwag in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 13 Sep 2008, 10:48 PM
  3. Task bar need help please
    By nutty2008 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 5 Sep 2008, 11:49 AM
  4. The ‘All Products ...’ link does not work / Adding a link on the Main Page
    By lancebotha in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 11 Jul 2006, 01:03 AM
  5. Changind the task bar text
    By scrappy in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 29 May 2006, 03:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg