Forums/How Do I ... ?

Options for Pagination Widget

Cindy
posted this on September 23, 2011, 07:51

In regards to this article - http://support.webvanta.com/article/77213-displaying-paginated-data..., 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.

 

Comments

User photo
Michael Slater
Webvanta

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.

September 23, 2011, 08:02
User photo
Cindy

Thanks, Michael.

September 23, 2011, 08:04
User photo
cmq

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

January 2, 2012, 16:19
User photo
Michael Slater
Webvanta

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}}>

January 19, 2012, 08:29