Announcement

Collapse
No announcement yet.

Go to 'top of page' problematic when user logged in

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Go to 'top of page' problematic when user logged in

    We need to put a link or button at the bottom of product pages to jump back to the top.
    The last post I can find on this was dated 2004 and didn't seem to me to have a resolution.
    Using Norman Rouxel's code from a post dated14 Nov 2009 we followed these instructions:

    In your Overall Layout, just after the <body .....> line, put the following:

    <a name="pagetop"></a>

    Where you want the button put:

    <a href="#pagetop">Top of page</a>

    That was a simple text link but you could have a button like:

    <input type="button" value="Top of page" onclick="location.href='#pagetop';"/>

    Or make up an image and use that:

    <a href="#pagetop"><img src="pagetopimage.gif" alt="Page Top"/></a>


    This worked fine until we enabled customer accounts. Now the logged in user is directed to the home page (which doesn't even have a tag at the top), and the logged in details are missing - although the user is still logged in as moving to a store page shows.

    Thinking that NOLOGIN was required, we changed the text link at the bottom to:
    <a href="#pagetop";NOLOGIN=1>Go to top of page</a>
    but it made no difference.

    Any suggestions please?
    many thanks

    #2
    The NOLOGIN=1 code is for use when linking to a Perl script not for a standard link. An anchor tag works on standard .html pages but customer accounts use Perl script URLs.
    Peblaco

    Comment


      #3
      Thank you very much for an excellent reply.
      "Live and learn" springs to mind!

      Comment


        #4
        Here's a solution that works on normal and cgi-bin based pages:
        At the place you want to scroll to, put:
        Code:
        <a id="pagetop" name="pagetop"></a>
        And use links like the following (I've shown both a normal link and a button):
        Code:
        <a href="javascript:document.getElementById('pagetop').scrollIntoView(true);" >Page Top</a>
        
        <input type="button" value="Page Top" onclick="document.getElementById('pagetop').scrollIntoView(true);" />
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment

        Working...
        X