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, Ed, biapar, Willr, Ingo, swaiba

Displaying only the first 3 Children

Go to End

2 Posts   1331 Views


Community Member, 8 Posts

1 June 2010 at 6:06pm

Edited: 01/06/2010 6:06pm

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

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;