Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    36
    Plugin Contributions
    0

    Default Link to home page

    How do I add a link to the home page in code.

    I know it's something like:

    <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>

    But what are the variables?

    Ta. D.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Link to home page

    It really depends on what you want to add.... if you're wanting to add a link to a non-Zen-Cart page, then simply follow the example without the PHP portion:
    HTML Code:
    <li><a href="http://url-to-go-to.com/path/etc.html">This is the name of my new link. Click me now!</a></li>
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    36
    Plugin Contributions
    0

    Default Re: Link to home page

    Yes, I guess I could just do it the easy way by putting:

    <li><a href="url">Text</a></li>
    But I want to add a link to the home of the site in PHP. If the 'Text' part was 'Home' what would happen when if I suddenly needed a second language. 'Home' should come from a language file somewhere shouldn't it? Does a variable exists for this? Can I define one? Where? And can the url part be built in the same way as all the others? ie using
    PHP Code:
    zen_href_link(FILENAME_LOGOFF'''SSL'); 
    What would the variables be for that?

    Sorry, to be picky. D.

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,622
    Plugin Contributions
    123

    Default Re: Link to home page

    I believe what you want is:

    <?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?>
    <?php echo HEADER_TITLE_CATALOG; ?></a>

    Of course, zillions of permutations of this exist, but you get the idea.

    Good luck.
    Scott
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    36
    Plugin Contributions
    0

    Default Re: Link to home page

    That will do nicely. Thank you very much.

    I was hoping it would be more on the lines of:
    PHP Code:
    zen_href_link(FILENAME_MAIN_PAGE'''NONSSL'); 
    for the url. But the [FONT="Courier New"]HEADER_TITLE_CATALOG[/FONT] was exactly what was needed for the text.

    Cheers, D.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Link to home page

    zen_href_link(FILENAME_DEFAULT);
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    36
    Plugin Contributions
    0

    Default Re: Link to home page

    FILENAME_DEFAULT ! Hurrah! I had tried all sorts of variable names. Thank you so much. D.

 

 

Similar Threads

  1. Home link links to default home page
    By roekoe in forum Addon Language Packs
    Replies: 0
    Last Post: 9 May 2011, 12:44 PM
  2. Error! Unable to determine the page link! in home page
    By mipavluk in forum General Questions
    Replies: 2
    Last Post: 2 Jan 2011, 12:37 AM
  3. adding in a 'home' and 'Page Top' link to bottom of product listing page
    By Sushigal in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 28 Jun 2010, 03:09 PM
  4. Another request for a home page link to my real home page
    By thesoundsmith in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 19 Jun 2008, 09:46 PM
  5. Replies: 2
    Last Post: 31 Jul 2007, 03:27 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR