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   1101 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, 147 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;
}