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

    Im not too sure how to do this, but im trying to create pagination on a customers testimonials page. the customers testimonials page has a tv called testimonials which allows items to be added to the list which works fine. the problem is that im trying to create a pagination for it. im trying to make it for every 8 testimonials show on each page

    my original code to call the tv was:

    [[!getImageList? &elementClass=`modSnippet`
    &tvname=`testimonials`
    &tpl=`testiItem`
    &limit=`8`
    ]]


    in the template i have changed this to:

    [[!getPage? &elementClass=`modSnippet`
    &element=`getImageList`
    &tvname=`testimonials`
    &tpl=`testiItem`
    &limit=`8`]]

    and added: [[!+page.nav]]

    but the pagination doesnt show anything?

    when i manually append to the end of the url ?page=2 on the testimonials page, it does show the remaining testionials but it also shows the blank template for the remaining testimonials that doesnt exist.

    not too sure what im doing wrong? please help smiley

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

      • 47401
      • 295 Posts
      ok, i think the code was right, i added <div class="pageNav pagination">[[!+page.nav]]</div> which seemed to show the pagination

      the next issue is that say on page 2 it should show the remaining testimonials which it does, for example if i had 10 testimonials all 8 show on page 1, and 2 show on page 2, but what it looks like its doing is still outputting the template 6 times on page 2.

      how can i get it to only output the template if a testimonial exists?
      • discuss.answer
        • 4172
        • 5,888 Posts
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 47401
          • 295 Posts
          hi bruno

          im not too sure what you mean?
            • 4172
            • 5,888 Posts
            try to replace your getImageList-snippet-code with that one from github and try it again.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 47401
              • 295 Posts
              hi

              that worked. the template is no longer showing blank testimonials, thank you for your help bruno17, much appreciated. smiley
                • 16899
                • 284 Posts
                Wow... i had exactly the same problem in my testimonials page... i replaced with the code mencioned below and it warked like a charm!! Don´t you think it´s a good idea to update this snippet in the next Migx update? smiley