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.

Data Model Questions /

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

Limit Results From DataFeed Without Custom Query?


Go to End


1985 Views

Avatar
Liam

Community Member, 470 Posts

29 May 2009 at 8:11am

Just curious if there was something built in by default to limit the result set of say <% control ChildrenOf(page-url) %>?

I know I could write a dataobject::get() in my controller to limit the results, but is there anything built in by default I could just put in my template?

I do stuff like this a lot and would save time/code.

i.e show last 5 articles in a section.

I thought I saw somebody mention something like <% range(0,5) %> a long time ago, but can't find anything through search.