We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36686
    • 165 Posts
    How do I set the number of documents to show on each page with page.nav? At the moment I’m not seing the pagination at all, which I suspect is because I have to few documents. Where/how do I change this, and what’s the default setting?
      • 22840
      • 1,572 Posts
      you need to add &limit=`4` to your get page call, change the 4 to whatever you want to limit to
        • 36686
        • 165 Posts
        I’m using getResources, but the principle should be the same, right? When I put &limit=`4` in the call the only result is that only four items are shown - no pagination appears. Does that mean I’m doing something else wrong? Maybe I should add that my getResources call is in a chunk that I call from the page (resource) I want it to appear on.

        <ul class="posts">[[getResources? &limit=`10` &showHidden=`1` &tpl=`bloggOchNyhetItem` &tplLast=`bloggOchNyhetItemLast` &includeContent=`1` &includeTVs=´1´ &hideContainers=`1`]]</ul>
        <div class="paging">
        <ul class="pageList">
          [[!+page.nav]]
        </ul>
        </div>
          • 22840
          • 1,572 Posts
          Not sure if it works with getresources but that is defonatly how it is done with get page, try calling your get resources uncached.

          [[!getResources? &limit=`10` &showHidden=`1` &tpl=`bloggOchNyhetItem` &tplLast=`bloggOchNyhetItemLast` &includeContent=`1` &includeTVs=´1´ &hideContainers=`1`]]

            • 36686
            • 165 Posts
            Still nothing. I also tried without the exclamation mark in the page.nav call, but nothing. Are you 100% sure limit is the property I’m looking for? In the documentation limit is described like this: "Limits the number of resources returned". To me that sounds more like the total number of resources, rather than number of resources per page... undecided
              • 22840
              • 1,572 Posts
              My call using getpage is below, i use the limit=`4` and it displays 4 per page with pagnation

              [[!getPage?
              &parents=`[[*id]]`
              &depth=`3`
              &tpl=`site-list`
              &sortby=`pagetitle`
              &tvPrefix=``
              &includeTVs=`1`
              &processTV=`1`
              &showHidden=`true`
              &limit=`4`
              &pageVarKey=`page`
              &element=`getResources`
              &elementClass=`modSnippet`
              &sortdir=`ASC`
              ]]
              <div class="paging">
              <ul class="pageList">
              [[!+page.nav]]
              </ul>
              </div>

              As I say I’m not even sure it works with get resources
                • 22303 MODX Staff
                • 10,725 Posts
                There is no page.nav in getResources; that is only in getPage.
                  • 36686
                  • 165 Posts
                  There is no page.nav in getResources; that is only in getPage.
                  You’re absolutely right OpenGeek, when I change it to getPage it works. Problem solved! It also seems to work with getResourcesTag, which I’m not sure why...? Maybe we’re just not meant to understand everything in this world smiley