Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    414
    Plugin Contributions
    0

    Default EZ Page "back to page top links"-how to code?

    Hi. I copied working HTML code to create a page that starts out with a list of topics (i.e., FAQs), with each topic title linking to the paragraph on that topic, and after that paragraph a "back to top" link going back to the top of the page.

    In EZ pages, none of the links work as expected. All links simply return to the home page. The home page shows the link name, i.e., "#publisher," or "#back," as an add-on to its web address.

    My code is:
    <a name="back"></a>
    <ol>
    <li><a href="#publisher">Search by publisher</a></li>
    . . .
    the above link in my html editor goes to:
    <h3><a name="publisher">1. Search by publisher</a></h3> . . .
    and when I finish the paragraph I can click a link
    <a href="#back"> Back to Top
    </a>

    which takes me back to the top.

    It is puzzling that this works in my HTML editor but not in the actual EZ page.

    It seems strange that the home page link would just rename itself, i.e., to "www.homepage.com/#publisher," or "www.homepage.com/#back, and strange that ANY link goes to the home page, whether #publisher, or #back.

    I suspect that this has something to do with PHP.

    Thanks for any explanatory comments.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: EZ Page "back to page top links"-how to code?

    Those "back to page top links" are called "anchors" ... which is what the "a" in <a href> stands for.

    Since Zen Cart uses <base href> to allow easy relative paths to be specified for images and stylesheets and javascripts, when you want to use named anchors, you must specify the full path to the page you're referencing.

    So, you could make your <a name="back"> link somewhere on your page, and then wherever you want to put a link to jump up/down to that named anchor, you simply enter <a href="index.php?main_page=pages?id=12345#back">
    You do have to specify all of that in addition to the #back anchor you're pointing to.
    (you *could* include the domain name too if you really want, but that shouldn't be necessary)
    .

    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
    Mar 2009
    Posts
    414
    Plugin Contributions
    0

    Default Re: EZ Page "back to page top links"-how to code?

    Dr. Byte, Thanks very much for the clear explanation and especially the example code.

    Notageek

  4. #4
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: EZ Page "back to page top links"-how to code?

    Putting the <a name="back"></a>, or <a name="top"></a>, or whatever you want to call the anchor, in

    includes\templates\YOUR_TEMPLATE\common\tpl_header.php

    immediately after and on the same line as <div id="headerWrapper">, or whatever you have to called the very first <div>,

    eg <div id="headerWrapper"><a name="top"></a>

    can save you having to put it on any other page.

 

 

Similar Threads

  1. v151 How to link "Back to Product List" button back to last page history
    By sports guy in forum General Questions
    Replies: 3
    Last Post: 28 Feb 2015, 11:11 AM
  2. How to delete links of "item name" and "price" in category list page?
    By rainmist in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 10 May 2010, 06:26 AM
  3. HTML "Back To Top" Code Not Working Properly In EZ Page
    By Earnest-Enterprises in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 14 Nov 2009, 09:53 PM
  4. Remove "Add Selected Items to Cart" button at top of page & Disabling links
    By ahuacatlan in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 28 Jul 2007, 04:04 AM
  5. Move "Home" & "Login" links at top of page
    By kp14 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 26 May 2007, 06:33 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