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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Displaying only the first 3 Children


Reply

2 Posts   1016 Views

Avatar
Noel

1 June 2010 at 6:06pm (Last edited: 1 June 2010 6:06pm), Community Member, 8 Posts

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

Avatar
Bruce B

3 June 2010 at 8:01pm Community Member, 145 Posts

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;
}