List item pagination question
2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 6, 2011 (RSS)
By kkegans - April 6, 2011
How would one make the pagination of a list go to the beginning after the last list item?
I want to create a featured item slider using CMSB and have the list items display in a continuous list. For example:
If the list contained 8 items and the display was 3 items at a time I would like to see
< | ITEM 1 | ITEM 2 | ITEM 3 | >
Then if the user clicks the next '>' arrow the next 3 items in the list would display.
< | ITEM 4 | ITEM 5 | ITEM 6 | >
By selecting the next arrow again, since there are only 8 items in the list viewer the list would display
< | ITEM 7 | ITEM 8 | ITEM 1 | >
returning to the first item after displaying item 8.
I would also like this to work in reverse if using the previous arrow.
Is this possible?
I want to create a featured item slider using CMSB and have the list items display in a continuous list. For example:
If the list contained 8 items and the display was 3 items at a time I would like to see
< | ITEM 1 | ITEM 2 | ITEM 3 | >
Then if the user clicks the next '>' arrow the next 3 items in the list would display.
< | ITEM 4 | ITEM 5 | ITEM 6 | >
By selecting the next arrow again, since there are only 8 items in the list viewer the list would display
< | ITEM 7 | ITEM 8 | ITEM 1 | >
returning to the first item after displaying item 8.
I would also like this to work in reverse if using the previous arrow.
Is this possible?
CMSB Rocks!
Thanks,
Kurt
Thanks,
Kurt
Re: [kkegans] List item pagination question
By Jason - April 6, 2011
Hi Kurt,
So if I understand correctly, the next one after that would then look like this:
< | ITEM 2 | ITEM 3 | ITEM 4 | >
Is that right? This is possible, but it can get there isn't a straight forward way of doing this using the 'perPage' option. One approach would be to use the 'offset' and 'limit' options instead of 'perPage'
(see [url http://www.interactivetools.com/docs/cmsbuilder/viewer_options.html]CMS Builder Docs[/url])
The simplest solution would be to output a link that goes back to the first page when you reach the end of your list. That that sense, you last page would look like this:
< | ITEM 7 | ITEM 8 | >
You could use code that looked like this to output a link to the first page when you reach the end:
Would this work for you? If you really need the first option, we could help you create this through our consulting service. If you're interested in this, please send an email to consulting@interactivetools.com.
Hope this helps
So if I understand correctly, the next one after that would then look like this:
< | ITEM 2 | ITEM 3 | ITEM 4 | >
Is that right? This is possible, but it can get there isn't a straight forward way of doing this using the 'perPage' option. One approach would be to use the 'offset' and 'limit' options instead of 'perPage'
(see [url http://www.interactivetools.com/docs/cmsbuilder/viewer_options.html]CMS Builder Docs[/url])
The simplest solution would be to output a link that goes back to the first page when you reach the end of your list. That that sense, you last page would look like this:
< | ITEM 7 | ITEM 8 | >
You could use code that looked like this to output a link to the first page when you reach the end:
<?php if(!$myRecordsMetaData['nextPage']): ?>
<a href = "<?php echo $myRecordsMetaData['firstPageLink'];?>"> > </a>
<?php endif ?>
Would this work for you? If you really need the first option, we could help you create this through our consulting service. If you're interested in this, please send an email to consulting@interactivetools.com.
Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/