Zen Cart Logo
Forums / General Questions / Using Anchor links in Ez-Pages

Using Anchor links in Ez-Pages

Locked

Views: 5,314

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
4 Jan 2008, 8:18 PM
#1
batteryman avatar

batteryman

Zen Follower

Join Date:
Jul 2004
Location:
Las Vegas
Posts:
327
Plugin Contributions:
0

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/index.php?main_page=page&id=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

4 Jan 2008, 9:01 PM
#2
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,841
Plugin Contributions:
0

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.

4 Jan 2008, 9:07 PM
#3
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

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
    <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
<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 Jan 2008, 10:15 PM
#4
batteryman avatar

batteryman

Zen Follower

Join Date:
Jul 2004
Location:
Las Vegas
Posts:
327
Plugin Contributions:
0

Re: Using Anchor links in Ez-Pages

banswidthjunkie:

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 <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
    <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.
5 Jan 2008, 12:32 AM
#5
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

Re: Using Anchor links in Ez-Pages

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

5 Jan 2008, 10:46 AM
#6
batteryman avatar

batteryman

Zen Follower

Join Date:
Jul 2004
Location:
Las Vegas
Posts:
327
Plugin Contributions:
0

Re: Using Anchor links in Ez-Pages

banswidthjunkie:

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/index.php?main_page=faq

5 Jan 2008, 12:22 PM
#7
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

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

7 Jan 2008, 7:47 AM
#8
batteryman avatar

batteryman

Zen Follower

Join Date:
Jul 2004
Location:
Las Vegas
Posts:
327
Plugin Contributions:
0

Re: Using Anchor links in Ez-Pages

Thank you, I saw that after I ad finished making it. I will download it and check it out. I make zen cart site like once a month.

24 Jan 2008, 6:43 PM
#9
helpme avatar

helpme

Totally Zenned

Join Date:
Apr 2007
Posts:
632
Plugin Contributions:
0

Re: Using Anchor links in Ez-Pages

I tried to do this but still am being redirected to my admin homepage and if I change it back again to <a hrep="#Q1"> it changes to my catalog homepage?
What am I doing wrong?

Also, I added this to my dropdown menu and it is calling for faq instead of faqs? I have looked everywhere and can find where it is calling faq from.
Thanks!

23 Oct 2008, 7:28 PM
#10
bluefirefly avatar

bluefirefly

New Zenner

Join Date:
Aug 2008
Posts:
44
Plugin Contributions:
0

Re: Using Anchor links in Ez-Pages

banswidthjunkie:

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
    <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
<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. :D
10 Nov 2009, 9:32 AM
#11
kobra8 avatar

kobra8

Zen Follower

Join Date:
Mar 2009
Location:
Serbia
Posts:
350
Plugin Contributions:
0

Re: Using Anchor links in Ez-Pages

banswidthjunkie:

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
    <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
<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??

:frusty: