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   600 Views

Avatar
shluckey

Community Member, 19 Posts

4 April 2013 at 5:12am

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

Avatar
simon_w

Forum Moderator, 474 Posts

4 April 2013 at 6:37am

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

Community Member, 19 Posts

7 April 2013 at 1:45am

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

Community Member, 19 Posts

13 April 2013 at 11:20am

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