We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2136
    • 134 Posts
    as i just found out, making a ’back to top link’ that goes to an anchor at the top of the page results in it going to the anchor on whatever is the site start page. ok, so i’d have to make it a variable for each page, and that works, but each page gets totally reloaded, resulting in a brief wait. the wait kinda defeats the purpose of a quick ’click this link to go back to nav instantaneously’ thingy. i assume then that this is a limitation of working with a cms, but i’m just checking to see if there’s any workaround.

    my solution is to just have the actual menu links so people can skip to another section rather than a back to menu that reloads the page in order for peeps to skip to another section.
      Sorry - not using ModX anymore 01/01/2007
      • 22815
      • 1,097 Posts
      If your pages are long, having menu links at both ends is usually good.

      But I think your issue is either due to you not using Friendly URLs, or to the presence of a base href in the template.
        No, I don't know what OpenGeek's saying half the time either.
        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
        Forum: Where to post threads about add-ons | Forum Rules
        Like MODx? donate (and/or share your resources)
        Like me? See my Amazon wishlist
        MODx "Most Promising CMS" - so appropriate!
        • 22303 MODX Staff
        • 10,725 Posts
        This should work fine if you create those links like this:

        <a href="[~[*id*]~]#anchorName" title="anchorName">Go to anchorName</a>
        
        ...
        
        <a name="#anchorName"></a>


        If you try to create them without the URL generated by [~[*id*]~], i.e. href="#anchorName", that is going to always go back to the root of the site.
          • 16429
          • 254 Posts
          Quote from: OpenGeek at Aug 29, 2006, 11:35 AM

          This should work fine if you create those links like this:

          <a href="[~[*id*]~]#anchorName" title="anchorName">Go to anchorName</a>
          
          ...
          
          <a name="#anchorName"></a>


          If you try to create them without the URL generated by [~[*id*]~], i.e. href="#anchorName", that is going to always go back to the root of the site.
          Mmm... are you sure?
          I’ve no problem at all setting anchors like
          <a href="#top" title="Go to the top">Go to the top</a>
          ...
          <a name="#top"></a>
          


          @arphaus
          Perhaps you’ve set the base-url in your template?
            kudo
            www.kudolink.com - webdesign (surprised?)

            [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
            • 34162
            • 1 Posts
            @arphaus:

            If your <base href="[(site_url)]" /> is set then use the following snippet call.

            // ###########################################
            // TopofPage                                 #
            // ###########################################
            // produces a link back to the top of the page
            //
            // ###########################################
            // Implementation                            #
            // ###########################################
            // [!TopofPage!]
            // 
            // Adjust "$output" for your needs
            //
            //
            //
            
            $toplink = $modx->makeUrl($modx->documentIdentifier);
            $toplink .="#top"; 
            $output ="<a href='$toplink' title='Jump to the top of the page'>Top of Page</a>";
            
            return $output;
            


            To see it working http://www.polo-pasion.co.uk

            Hope it helps