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.

Template Questions /

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

Pagination for a control over a has_many relationship


Go to End


2 Posts   1964 Views

Avatar
baba-papa

Community Member, 279 Posts

2 December 2009 at 11:18pm

Edited: 02/12/2009 11:31pm

I have a product category that has a has_many relationship to products. The products are shown in the category´s template:

<%control relationName %>

How can I add a pagination to this template?
I know how to implement a pagination on a control over a DataObjectSet but this is different because the DataObjectSet is created by the framework.

Avatar
baba-papa

Community Member, 279 Posts

3 December 2009 at 1:10am

By now I have solved this by writing a controller method that returns a DataObjectSet and passed the required parameter to DataObject::get(). I presume there is a more efficent way to do that.