Options for Pagination Widget

In regards to this article - http://support.webvanta.com/article/77213-displaying-paginated-database-results, is there a way to set the page option so the items are paginated by date, rather than item numbers?  For example, page 1 shows all items from 2010, pages 2 shows all items from 2009, etc.

Have more questions? Submit a request

4 Comments

  • 0
    Avatar
    Michael Slater

    No, we don't have such an option. The pagination system requires a fixed number of items per page so there is no way to align it with dates.

    You create a series of date links, that would be like the date pagination links you described, which would set up queries for items in a date range using URL parameters.

  • 0
    Avatar
    Cindy

    Thanks, Michael.

  • 0
    Avatar
    cmq

    Michael - could you expound a bit on ..."which would set up queries for items in a date range using URL parameters"....?  Thanks!

  • 0
    Avatar
    Michael Slater

    You could set up URLs on your date links like <a href="/list-page?start_date=2012-01-01&end_date=2012-01-30">January 2012</a>.

    Then, on the list-page, you can access those parameters using Webvanta's var syntax, to put them into an iterator condition, something link (untested):

    <w:kb:item:each type="whatever-the-item-type-is" condition="published_at >= {{start_date}} && published_at <= {{end_date}}>

Please sign in to leave a comment.
Powered by Zendesk