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

Answered Blox and Paging

    • 48272
    • 24 Posts
    I have a simple question about bloX; if I use paging AND a where-statement my pagination doesn't work correctly. It seems that I get the number of pages without the where-condition. Am I missing something obvious?!

    [[!getPage?
            &element=`bloX`  
    	&packageName=`clients`
    	&packagename=`clients`
    	&classname=`Request`
    	&where=`{"type:=":"2"}`
    	&tpls=`bloxouter:tplRequestOuter||row:tplRequest` 
            &limit = `5`
    	&debug=`0` 
    	]]
    
    [[!+page.nav]]


    (By the way; I cannot remember the exact problem, but I had to use &packageName=`clients` and &packagename=`clients` with bloX or migxLoopCollection to get the correct output. Does anyone had the same issue?! )

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

    • discuss.answer
      • 4172
      • 5,888 Posts
      I would use migxLoopCollection like that:

      [[!getPage?
          &element=`migxLoopCollection` 
          &packageName=`clients`
          &classname=`Request`
          &where=`{"type:=":"2"}`
          &tpl=`tplRequest`
          &wrapperTpl=`tplRequestOuter`
          &limit = `5`
          &debug=`0`
      ]]
       
      [[!+page.nav]]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 48272
        • 24 Posts
        I was not aware of the fact that migxLoopCollection also supports a wrapperTpl. I will try this. Thanks.

        Quote from: Bruno17 at Sep 15, 2014, 05:06 AM
        I would use migxLoopCollection like that:

        [[!getPage?
            &element=`migxLoopCollection` 
            &packageName=`clients`
            &classname=`Request`
            &where=`{"type:=":"2"}`
            &tpl=`tplRequest`
            &wrapperTpl=`tplRequestOuter`
            &limit = `5`
            &debug=`0`
        ]]
         
        [[!+page.nav]]
          • 4172
          • 5,888 Posts
          Quote from: egraaf at Sep 16, 2014, 06:26 AM
          I was not aware of the fact that migxLoopCollection also supports a wrapperTpl. I will try this. Thanks.


          since 2.8.1
          see changelog:
          http://modx.com/extras/package/migx
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 48272
            • 24 Posts
            Quote from: Bruno17 at Sep 16, 2014, 06:31 AM
            Quote from: egraaf at Sep 16, 2014, 06:26 AM
            I was not aware of the fact that migxLoopCollection also supports a wrapperTpl. I will try this. Thanks.


            since 2.8.1
            see changelog:
            http://modx.com/extras/package/migx

            It took me some time to make it work. I used the bloX-templates but the content was empty. In stead of [[+innerrows.row]] I have to use [[+output]] in the wrapper. I could not find this on the internet and I had to look in the sourcecode. But the pagination works fine now. Thanks.