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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

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

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

2.4.7 Pagination [SOLVED]


Go to End


4 Posts   1288 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
(deleted)

Community Member, 473 Posts

4 April 2013 at 6:37am

The closest there is is the doc block comment for DataObjectSet::PaginationSummary()

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