Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Back to top anchor in footer.

Back to top anchor in footer.

Locked

Views: 1,570

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
20 Aug 2006, 5:48 AM
#1
ale_elatey avatar

ale_elatey

New Zenner

Join Date:
Aug 2006
Posts:
3
Plugin Contributions:
0

Back to top anchor in footer.

I've been successfully using this code for a while:

<a href="<?php echo zen_href_link(substr($_SERVER['REQUEST_URI'], 1)); ?>#top">Top of Page</a>

For some reason after updating the latest version of Zen Cart, the links became broken.

The new code is:

<a href="<?php echo zen_href_link(substr($_SERVER['REQUEST_URI'], 21)); ?>#top">Top of Page</a>

Note the number 21 instead of 1.

It seems to work now.

Just thought I'd share.

Ale.

20 Aug 2006, 6:20 AM
#2
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: Back to top anchor in footer.

Thank for the share! :smile:

1 Sep 2006, 7:24 AM
#3
all80 avatar

all80

New Zenner

Join Date:
Jul 2006
Posts:
7
Plugin Contributions:
0

Re: Back to top anchor in footer.

I've been having an error on the home page:

"unable to determine the page link"

Found that the error was due to the code I'm using for the top of page anchor.

New code seems to work but is a cludgy hack:

<a href="<?php if (strlen($_SERVER['REQUEST_URI']) > 21) echo zen_href_link(substr($_SERVER['REQUEST_URI'], 21)); ?>#top">Top of Page</a>

If you have a better idea, please let me know.

28 Nov 2006, 5:02 PM
#4
shamusomalley avatar

shamusomalley

Zen Follower

Join Date:
Jun 2005
Location:
Center of the Universe
Posts:
192
Plugin Contributions:
0

Re: Back to top anchor in footer.

this works for me:

href="<?php echo substr($_SERVER['REQUEST_URI'], 1); ?>#"