We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36626
    • 51 Posts
    Hello,
    I'm going crazy trying to implement getPage to paginate results from getResources. Nothing I've tried has worked. I'm running 2.2.4 php5.

    [[!getResources?  &parents=`[[*id]]`   &tpl=`prodTpl-3alt`     &includeTVs=`1`  &processTVs=`1` &showHidden=`FALSE` &sortby=`menuindex` &sortdir=`ASC` &hideContainers=`1` &limit =`9`]]


    getPage

    [[!getPage?
       &elementClass=`modSnippet`
       &element=`getResources`
     	 &depth=`2`
       &parents=`[[*id]]`
    
       &limit=`9`
       &pageVarKey=`page`
    
       &includeTVs=`1`
       &includeContent=`1`
    			&tvPrefix=`1`
     
       &tpl=`pageList`
    ]]
    <section class="row">
    
      [[!+page.nav]]
    
    </section>


    I just can't figure out what I'm missing. Any input is greatly appreciated.

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

      • 4172
      • 5,888 Posts
      does this show the items, you want to paginate?

      [[!getResources?
         &depth=`2`
         &parents=`[[*id]]`
         &limit=`9`
         &includeTVs=`1`
         &includeContent=`1`
         &tvPrefix=`1`
         &tpl=`pageList`
      ]]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 36626
        • 51 Posts
        No. That particular getResources call does not work.
        • discuss.answer
          • 4172
          • 5,888 Posts
          ok, then, which getResources - call is working?

          You just need to take the working getResources - call, replace

          'getResources' with 'getPage' in the snippet-tag and add
           &element=`getResources`
          to the snippet-tag.

          You replace getResources just with getPage.
          getPage is a wrapper-snippet which runs the element internally and adds functionality for pagination.

          That said, if the same getResources-tag isn't working, the getPage-tag can't work.

            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 36626
            • 51 Posts
            Ah, okay I see where I went wrong. I misunderstood the documentation and thought that both a getResources and getPage call were required in the document. I changed my getResources call to getPage and it's working.

            Thanks for your help.
              • 10378
              • 375 Posts
              Could you please mark this thread as solved? (click on the star in the upper right corner of the answer that solved the problem). So this thread will disappear from then unsolved questions. Thanks!
                Freelancer @bitego http://www.bitego.com
                ---
                GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
                More infos here: http://www.bitego.com/extras/goodnews/