Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Jul 2004
    Location
    Las Vegas
    Posts
    477
    Plugin Contributions
    0

    Default Using Anchor links in Ez-Pages

    How do I use an Anchor Link in Zen-Cart in the eZ-Pages?

    What I'm doing is using anchor links in a FAQ Page on my site and when you click on the link it simply go to the home page.

    http://www.batteriesinaflash.com/ind...d=13&chapter=0

    The link there will take you to my FAQ page.

    I have a TOC of the issues on top with anchor links which when clicked on should jump down to the corresponding issue.

    Thank you for the help in advanced.
    Avel
    User of zencart

  2. #2
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,888
    Plugin Contributions
    0

    Default Re: Using Anchor links in Ez-Pages

    it is the <base href="http://www.batteriesinaflash.com/" /> in the head of the page that breaks the anchor tags. The Achille's Heel of the base href tag is that anchor links will all resolve to the homepage unless you include the relative path of the document also.
    Mike
    AEIIA - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  3. #3
    Join Date
    Nov 2007
    Posts
    195
    Plugin Contributions
    2

    Default Re: Using Anchor links in Ez-Pages

    There are two ways that I know of, the possibly wrong way (quicker) and the possibly right way:

    1) Change all of your links to
    HTML Code:
    <a href="index.php?main_page=page&id=13&chapter=0#YOUR_ANCHOR_NAME">
    2) Make a new define page called faq (or whatever), put everything in that, point your ez-page to that define page and change all your links to
    PHP Code:
    <a href="<?php echo $_SERVER['REQUEST_URI']; ?>#payment-methods">
    .

    (I think) The second method is better, because it won't go wrong if you change the ez-pages in some way.

  4. #4
    Join Date
    Jul 2004
    Location
    Las Vegas
    Posts
    477
    Plugin Contributions
    0

    Default Re: Using Anchor links in Ez-Pages

    Quote Originally Posted by banswidthjunkie View Post
    There are two ways that I know of, the possibly wrong way (quicker) and the possibly right way:

    1) Change all of your links to
    HTML Code:
    <a href="index.php?main_page=page&id=13&chapter=0#YOUR_ANCHOR_NAME">
    2) Make a new define page called faq (or whatever), put everything in that, point your ez-page to that define page and change all your links to
    PHP Code:
    <a href="<?php echo $_SERVER['REQUEST_URI']; ?>#payment-methods">
    .

    (I think) The second method is better, because it won't go wrong if you change the ez-pages in some way.
    Could I just change all of my link in the current page to to the second suggestion. That would take me 3 minutes.
    User of zencart

  5. #5
    Join Date
    Nov 2007
    Posts
    195
    Plugin Contributions
    2

    Default Re: Using Anchor links in Ez-Pages

    You could, but it wouldn't work, because you can't use php in ez-pages.

  6. #6
    Join Date
    Jul 2004
    Location
    Las Vegas
    Posts
    477
    Plugin Contributions
    0

    Default Re: Using Anchor links in Ez-Pages

    Quote Originally Posted by banswidthjunkie View Post
    You could, but it wouldn't work, because you can't use php in ez-pages.
    Ahh, yes I see! that would make it pointless.

    So I took your second suggestion and took the about_us define package in the downloads swapped it all out to be the faq and then modified my faq to include the dynamic links and then uploaded it all. works perfectly. Took more time swtching all the files to say 3 letters than it did to make the faq and upload it.


    Thank you, works perfect.

    http://www.batteriesinaflash.com/ind...?main_page=faq
    User of zencart

  7. #7
    Join Date
    Nov 2007
    Posts
    195
    Plugin Contributions
    2

    Default Re: Using Anchor links in Ez-Pages

    If you want to make new define pages in the future, you can use the define pages editor mod I wrote, it's a bit easier. See the link in my signature

  8. #8
    Join Date
    Aug 2008
    Posts
    44
    Plugin Contributions
    0

    Default Re: Using Anchor links in Ez-Pages

    Quote Originally Posted by banswidthjunkie View Post
    There are two ways that I know of, the possibly wrong way (quicker) and the possibly right way:

    1) Change all of your links to
    HTML Code:
    <a href="index.php?main_page=page&id=13&chapter=0#YOUR_ANCHOR_NAME">
    2) Make a new define page called faq (or whatever), put everything in that, point your ez-page to that define page and change all your links to
    PHP Code:
    <a href="<?php echo $_SERVER['REQUEST_URI']; ?>#payment-methods">
    .

    (I think) The second method is better, because it won't go wrong if you change the ez-pages in some way.
    Thank you! The second way worked like a charm.

  9. #9
    Join Date
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default Re: Using Anchor links in Ez-Pages

    Quote Originally Posted by banswidthjunkie View Post
    There are two ways that I know of, the possibly wrong way (quicker) and the possibly right way:

    1) Change all of your links to
    HTML Code:
    <a href="index.php?main_page=page&id=13&chapter=0#YOUR_ANCHOR_NAME">
    2) Make a new define page called faq (or whatever), put everything in that, point your ez-page to that define page and change all your links to
    PHP Code:
    <a href="<?php echo $_SERVER['REQUEST_URI']; ?>#payment-methods">
    .

    (I think) The second method is better, because it won't go wrong if you change the ez-pages in some way.
    Can somebody please explain how to insert the anchor.
    1. I made a new page with define_pages_generator_v0-3
    2. I point ez-page to thet pages with Internal Link URL.
    3. Is I puting tex in Admin with, define_pages_editor.php??
    4. When I put tex, hay to make ANCHOR??


 

 

Similar Threads

  1. Html anchor links in product pages
    By petek in forum General Questions
    Replies: 0
    Last Post: 22 Apr 2011, 04:28 PM
  2. Anchor Links
    By autoace in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 2 Mar 2011, 12:32 PM
  3. Replies: 3
    Last Post: 22 May 2010, 11:41 PM
  4. Using Anchor Links in Ezpages
    By JollyJim in forum Templates, Stylesheets, Page Layout
    Replies: 20
    Last Post: 14 Nov 2009, 06:39 PM
  5. creating anchor links in defined pages like shippinginfo.html
    By shocker in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 7 Dec 2008, 11:35 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