We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40088
    • 708 Posts
    I've read the docs but I'm struggling to get pagination dialed-in with getPage.

    I have several nested folders and need a listing of each folder's differing number of child pages.

    Using this:

    [[!getPage?
       &elementClass=`modSnippet`
       &element=`getResources`
       &parents=`79`
       &depth=`1`
       &limit=`10`
       &pageVarKey=`page`
       &includeContent=`1`
       &tpl=`pagination`
    ]]



    I get the appropriate number of child pages rendered for folder (id 79) but here's where I get stuck:

    1. I would like the call to do its thing without having to explicitly declare a parent id for each folder (as shown), i.e. one call that works in any folder. Does that make sense?

    2. I can't figure out how to get my 'pagination' tpl to display an unordered list of numbers (Previous 1 2 3 4 Last). I have the list structure in place (in the tpl) but it's the MODX variables I can't get figure out.

    Thanks
      Todd
      • 30585
      • 833 Posts
      1. I would like the call to do its thing without having to explicitly declare a parent id for each folder (as shown), i.e. one call that works in any folder. Does that make sense?

      use this:
       &parents=`[[*parrent]]`


      This will update the parent based on the current resource
        A MODx Fanatic