We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40088
    • 708 Posts
    Revo 2.6.1

    I'm using pdoResources to list the resources of three different folders, all on a single page. Each group of resources is wrapped in its own parent container with its own id (and pagination). For example:
    <section id="one">
    …
    <resources here>
    ...
    <paging controls>
    </section>
    
    <section id="two">
    …
    <resources here>
    ...
    <paging controls>
    </section>
    
    <section id="three">
    …
    <resources here>
    ...
    <paging controls>
    </section>

    Works great.

    What I would like to do is append the paging url with the id (anchor) of the parent section. So for example, if a paging link in section 3 were clicked the id three would get tacked on like this, mysite/results.html?reviews=2#three or like this mysite/results.html?tutorials=2&reviews=2#three (depending on which and how many sections are being "paged"). This way the user is taken directly to the relevent section on the new page without having to scroll. Anchor 101.

    My problem is I'm uncertain how to grab the correct id on the fly and append it. Or if it's even possible.
      Todd
      • 3749
      • 24,544 Posts
      Just spitballing here. This is kind of a goofy idea, but I wonder if it would be possible to adjust your Tpl chunks to make every link a form with method="get", the action as the target page, and the submit button styled as a link. Then embed hidden input field(s) in each form containing the params for the URL.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 40088
        • 708 Posts
        Interesting @BobRay. I never would have thought of that approach.

        I'm thinking whatever approach I take it will be a lot of fuss for a very small payoff. That being said I got curious and tried something else.

        I created 3 different psets, one for each section with the anchor hard-coded into the respective paging templates. It works fine but it's a lot of overhead for a simple anchor.

        I may have to let this one go.

        Thanks.

        [ed. note: todd.b last edited this post 6 years, 1 month ago.]
          Todd