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

    I have a simple TV "listDoc" with MIGX configurate like this:
    [
    	{"caption":"Info", "fields":
    		[
    			{"field":"title","caption":"Titre"},
    			{"field":"date","caption":"Date","inputTVtype":"date"},
    			{"field":"image","caption":"Fichier","inputTVtype":"file","sourceFrom":"migx"},
    			{"field":"description","caption":"Descriptif","inputTVtype":"textarea"},
    			{"field":"type","caption":"Type de document","inputTVtype":"listbox","inputOptionValues":"Document PDF==pdf||Document Word==word||Fichier texte==text||Document Excel==excel||Document Powerpoint==powerpoint||Archive ZIP==archive"}
    		]
    	}
    ]


    Then, I use this:
    [[getImageList? &tvname=`listDoc` &sort=`[{"sortby":"date","sortdir":"DESC"}]` &tpl=`listDoc`]]


    But, if I have 60 documents, my page will be too many longuer. So, I want to paginate. In the doc of MIGX, I read that I can use the propertie totalVar because it's “usefull together with getPage for pagination”. Great, but I have no explanation (neither in the getPage documentation). How can I do? Please.
      • 28432
      • 372 Posts
      Hi neoziox,

      In this thread i think you have an example : https://forums.modx.com/thread/92407/using-idx-placeholder-in-getimagelist-with-pagination

      [[!getPage?
      &element=`getImageList`
      &tpl=`yourOwnTpl`
      &limit=`20`
      &tvname=`yourTV`
      &pageVarKey=`yourPageVarKey`
      &pageNavVar=`page.nav`
      &totalVar=`yourTotalVar`
      ]]


      I hope this help.
        • 37909
        • 153 Posts
        Yes, I already tried this. But it doesn't works: nothing appear!

        I forgot one important property:
        [[getImageList? &docid=`5` &tvname=`listDoc` &sort=`[{"sortby":"date","sortdir":"DESC"}]` &tpl=`listDoc`]]
          • 30585
          • 833 Posts
          Is getPage installed? Steeve's answer should work. You should also make sure that your listDoc tpl chunk exists.
          [[!getPage?
            &element=`getImageList`
            &docid=`5`
            &tvname=`listDoc` // => TV
            &tpl=`listDoc` // => chunk
            &sort=`[{"sortby":"date","sortdir":"DESC"}]`
          ]]

          And don't forget the pagination links:
          <div class="pagination">[[!+page.nav]]</div>
            A MODx Fanatic
            • 37909
            • 153 Posts
            Shame on me!
            I deserve a big shame!

            getPage wasn't installed…

            A big apologize and I go to hide myself.

            Thanks!
              • 37909
              • 153 Posts
              I guess I need vacations.
                • 30585
                • 833 Posts
                Glad it worked for you.
                  A MODx Fanatic