We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33608
    • 27 Posts
    that was a terrible title, but maybe I can explain what I’m trying to do. laugh

    I have getPage and getResources set up and working super awesome. according to the design specs I’ve been given, I need to display something that shows the current numbers of the elements that were returned. here’s an example:

    [[!getPage?
    &element=`getResources`
    &parents=`2`
    &includeTVs=`1`
    &tvPrefix=``
    &tpl=`listViewTpl`
    &limit=`5`
    &sortby=``
    &sortbyTV=`Ele Name`
    &sortdirTV=`ASC` ]]

    This would return all children of resource 2, and would put 5 per page. I need to have someway to display "Showing 1-5" on page 1, "Showing 6-10" on page 2, etc...

    Is there a placeholder that works this way, or do I have to do a bunch of javascript to sniff out how many elements are being displayed, and what the starting number is (the page has a link to return a certain number of elements based on a $_GET variable)?
      • 27347
      • 65 Posts
      I needed the same thing today for a pagination section on a news archive. I used the getResourcesTag snippet, but i think this also applies to your call.
      It isn’t clearly documented or maybe i’m looking in the wrong place. A look in the cache files led me to the answer, all the properties/values you need are at your disposal:

      Showing [[!+firstItem]]-[[!+lastItem]] | Total: [[!+total]]


      Should do the trick.