Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2007
    Posts
    37
    Plugin Contributions
    0

    Default Adding a link to the top of the page

    Hi!

    How can I add a link to the top of the page (Where "Home", "Log in", etc. show)?

    Thank you!

    - Paul

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Adding a link to the top of the page

    There are several that do not display until logged in and till there is cart contents so you will have to determine where in this string that you want yours to be displayed.
    In a copy of the file that you place in your template /common folder named tpl_header.php find this code that is all of the items that can appear and insert yours as an additional li with your associated href
    Code:
    <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>
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Aug 2007
    Posts
    37
    Plugin Contributions
    0

    Default Re: Adding a link to the top of the page

    Awsome!
    Thanks a lot!

    Just one more question about this: can I align the newly added links to the right somehow?
    When I just add another div container it is not formatted correctly anymore.
    Do you have an idea?

    Thanks!!

    - Paul

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Adding a link to the top of the page

    Try this
    Code:
    <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 }?>
    <div id="?newdivname?">
        <ul class="forward">
        <li><a href="http://your link.com/">Name to appear</a></li> 
        </div>
    </ul>
    </div>
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Aug 2007
    Posts
    37
    Plugin Contributions
    0

    Default Re: Adding a link to the top of the page

    Hi!

    Thanks a lot, but I have tried this and it doesn't work.
    The new links are then in a second line, not next to, and aligned to the right of the main-links, but underneath and aligned to the right of the main-links.
    Do you maybe have another idea?

    Thanks!

    - Paul

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Adding a link to the top of the page

    OK this will get it:
    Code:
    <?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="nav2"><a href="http://your link.com/">Link To Nothing</a></div>
    <div class="navMainSearch forward"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
    <br class="clearBoth" />
    </div>
    and in the stylesheet add:
    Code:
    #nav2 {
    	float: right;
    	margin: 0.5em;
    	}
    Zen-Venom Get Bitten

 

 

Similar Threads

  1. v150 Changing the 'Support Site' link on top-right of the admin page?
    By yelow in forum Customization from the Admin
    Replies: 2
    Last Post: 12 Mar 2012, 08:07 PM
  2. Replies: 3
    Last Post: 23 Sep 2008, 06:25 PM
  3. Adding a graphic at the top of my page...
    By helexia23 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 4 Apr 2008, 02:02 AM
  4. Adding an External Link in the Top Nav
    By blakemiller in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 20 Mar 2007, 10:45 PM
  5. 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

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