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

Displaying only the first 3 Children


Go to End


2 Posts   1571 Views

Avatar
Noel

Community Member, 8 Posts

1 June 2010 at 6:06pm

Edited: 01/06/2010 6:06pm

I want the ArticleHolder.ss (as per the tutorial) to only display the first 3 Children.
Any ideas anyone?

Avatar
Bruce B

Community Member, 164 Posts

3 June 2010 at 8:01pm

You need to add your own function to do this. The following 'might' work:

function FewChildren($limit) {
$littlechildren = DataObject::get("SiteTree", "ParentID = $this->ID", "", null, $limit);
return $littlechildren;
}