Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / 'Back to Top' link... how?

'Back to Top' link... how?

Locked

Views: 901

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
12 Aug 2007, 6:09 PM
#1
billybonds avatar

billybonds

Zen Follower

Join Date:
Nov 2003
Location:
UK
Posts:
102
Plugin Contributions:
0

'Back to Top' link... how?

Hi

I am having difficulty getting a 'back to top' link working on each page.

My effort has been to open templates/MY_TEMPLATE/common/tpl_main_page.php and make a new containing div for the whole page where I put my fixed links and then at the top of <div id="mainWrapper"> put my top link...

<div id="background_wrapper">

<![if !IE 6]>

    <div id="fixed-nav">
        <a href="../index.html"><img src="http://africanartandmasks.com/images/home_icon.png" alt="Go back to our Home Page" title="Go back to our Home Page" /></a>
        <a href="index.php"><img src="http://africanartandmasks.com/images/eshop_icon.png" alt="Enter our eshop" title="Enter our eshop" /></a>
        <a href="mailto:[email protected]"><img src="http://africanartandmasks.com/images/email_icon.png" alt="Send us an email..." title="Send us an email..."/></a>
        <a href="#top"><img src="http://africanartandmasks.com/images/top_icon.png" alt="Go back to the top of this page" title="Go back to the top of this page" /></a>    
    </div>
    
<![endif]>

    <!-- main_wrapper starts -->
    
<div id="mainWrapper">
<a name="top" id="top"></a>
<?php
 /**
  * prepares and displays header output
  *
  */............
```This works fine in eshop/index.php (i.e. it scrolls back to the top of the page) but in any other page it takes you back to eshop/index.php

Can this be made to work?

Page is [here](http://africanartandmasks.com/eshop/index.php) (If its a mess I've yet to really work on ie - firefox is ok).

Thank you.
12 Aug 2007, 7:01 PM
#2
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: 'Back to Top' link... how?

billybonds:

Hi

I am having difficulty getting a 'back to top' link working on each page.

My effort has been to open templates/MY_TEMPLATE/common/tpl_main_page.php and make a new containing div for the whole page where I put my fixed links and then at the top of <div id="mainWrapper"> put my top link...

<div id="background_wrapper">

<![if !IE 6]>

<div id="fixed-nav">
    <a href="../index.html"><img src="http://africanartandmasks.com/images/home_icon.png" alt="Go back to our Home Page" title="Go back to our Home Page" /></a>
    <a href="index.php"><img src="http://africanartandmasks.com/images/eshop_icon.png" alt="Enter our eshop" title="Enter our eshop" /></a>
    <a href="mailto:[email protected]"><img src="http://africanartandmasks.com/images/email_icon.png" alt="Send us an email..." title="Send us an email..."/></a>
    <a href="#top"><img src="http://africanartandmasks.com/images/top_icon.png" alt="Go back to the top of this page" title="Go back to the top of this page" /></a>    
</div>

<![endif]>

<!-- main_wrapper starts -->
<div id="mainWrapper"> <a name="top" id="top"></a> <?php /** * prepares and displays header output * */............ ```This works fine in eshop/index.php (i.e. it scrolls back to the top of the page) but in any other page it takes you back to eshop/index.php > > Can this be made to work? > > Page is [here](http://africanartandmasks.com/eshop/index.php) (If its a mess I've yet to really work on ie - firefox is ok). > > Thank you.

Not sure if this still works, but look here:

http://www.zen-cart.com/forum/showthread.php?t=2627

see dreamscape's solution near the bottom of the link.

12 Aug 2007, 7:36 PM
#3
billybonds avatar

billybonds

Zen Follower

Join Date:
Nov 2003
Location:
UK
Posts:
102
Plugin Contributions:
0

Re: 'Back to Top' link... how?

:clap::clap::clap:

Thank you for the link. I've been searching to no avail. Works a treat, thanks again (and of course thanks to Dreamscape!)