We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32300
    • 17 Posts
    I have a snippet which gets data from a table I made using an xpdo model. What I would like to do is put this through getPage so I can paginate the data and template it out placing the different fields into chunk placeholders for each row. But I haven’t been able to find much information on getPage (nothing in the wiki), my understanding of it comes from getResources alone really.

    I am guessing you would output an array somehow in the snippet?

    Any help would be appreciated.
      • 3749
      • 24,544 Posts
      See if this helps:

      http://modxcms.com/forums/index.php?topic=46346.0

      Here’s an example:
        [[!getPage?
         &elementClass=`modSnippet`
         &element=`YourSnippet`
      
         &parents=`17`
         &depth=`2`
         &limit=`10`
         &pageVarKey=`page`
      
         &includeTVs=`1`
         &includeContent=`1`
      
         &tpl=`blogListPost`
      ]]
      <div class="paging">
      <ul class="pageList">
        [[!+page.nav]]
      </ul>
      </div>
        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
        • 32300
        • 17 Posts
        Thank you that was helpfull.

        Also on a side note is there a correct way to get variables from urls in modx? Or is the php $_GET command the best way to do it?