Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

2.4.7 Pagination [SOLVED]


Reply

4 Posts   587 Views

Avatar
shluckey

4 April 2013 at 5:12am Community Member, 19 Posts

Is there a doc for creating pagination on 2.4.7 can't find anything?

Avatar
simon_w

4 April 2013 at 6:37am Forum Moderator, 474 Posts

The closest there is is the doc block comment for [url=http://api.silverstripe.org/2.4/source-class-DataObjectSet.html#285-391]DataObjectSet::PaginationSummary()[/url]

Avatar
shluckey

7 April 2013 at 1:45am Community Member, 19 Posts

Hey thanks for the reply simon_w, after looking through this i'm still struggling to get it to work. You can't use children for the pagination? eg. Children.PaginatedSummary(1) so i'm trying to create a function that grabs all of the children so it would be like AllNewsPosts.PaginatedSummary(1), however I don't think I'm doing this right either as its not working correctly. Any advice?

function AllNewsPosts($num=1) {
   $news = DataObject::get_one("NewsHolder");
   return ($news) ? DataObject::get("NewsEntry", "ParentID = $news->ID", "Date DESC", "", $num) : false;
   }

Avatar
shluckey

13 April 2013 at 11:20am Community Member, 19 Posts

Used this article to get it working http://www.ssbits.com/tutorials/2010/paginating-a-filtered-dataobjectset/