We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37746
    • 42 Posts
    Hi all

    I have seen this covered elsewhere in the forum but the final solution wasn't added.

    I am using getpage to aggregate articles in a collection but am getting some weird results in terms of the pagination itself. I want to limit it to the built-in controls and 5 page links no matter how far you go. But I am getting up to 11 page links when I go above page 6. I thought the &pageLimit property would do what I wanted. Here is my code;

    [[!getPage? 
    &elementClass=`modSnippet` 
    &element=`getResources` 
    &parents=`[[*id]]` 
    &limit=`10` 
    &pageLimit=`5` 
    &tpl=`bvFeedContainerTpl` 
    &includeContent=`1` 
    &includeTVs=`1` 
    &processTVs=`1` 
    &totalVar=`total` 
    &offset=`0` 
    &pageVarKey=`page`]]
    


    Anyone got an idea what I am doing wrong please?

    This question has been answered by markh. See the first response.

    • discuss.answer
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      I think &pageLimit should be interpreted as the number of pages in a certain direction. So &pageLimit=`5` would show 5 pages back and 5 pages forward (plus the current = your 11 links).

      Maybe pdoPage is more flexible in defining the page limits the way you want it...
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 37746
        • 42 Posts
        Quote from: markh at Mar 26, 2018, 01:16 AM
        I think &pageLimit should be interpreted as the number of pages in a certain direction. So &pageLimit=`5` would show 5 pages back and 5 pages forward (plus the current = your 11 links).

        Maybe pdoPage is more flexible in defining the page limits the way you want it...

        That's it, thanks Mark. Didn't even compute that it would be 5 each way but I guess that makes sense. Dropped it to two and I have my five link limit.

        Cheers fella smiley