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

Prev, next on dataobject page.


Go to End


10 Posts   4346 Views

Avatar
S. Kriss

Community Member, 1 Post

17 March 2017 at 6:08am

Edited: 17/03/2017 6:10am

I just found this topic, and got trouble. The code in previous post does not work with ss 3.5x (Latest Stable Version)
In Portfolio.php must change the code to

public function PreviousPage() {    
	return  Portfolio::get()->filter('ID:LessThan',$this->ID)->sort(array('ID' => 'DESC'))->first();
}
public function NextPage() {    
	return  Portfolio::get()->filter('ID:GreaterThan',$this->ID)->sort(array('ID' => 'ASC'))->first();
}

This works for me, and hope this will help someone who get this trouble.

Avatar
aeclub

Community Member, 1 Post

17 March 2017 at 11:13pm

Edited: 17/03/2017 11:13pm

Thank for code.

โรยัล 1688

Go to Top