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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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