Jump to:

23453 Posts in 18902 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Displaying only the first 3 Children

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

Page: 1
Go to End
Author Topic: 953 Views
  • Noel
    Avatar
    Community Member
    8 Posts

    Displaying only the first 3 Children Link to this post

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

  • Bruce B
    Avatar
    Community Member
    145 Posts

    Re: Displaying only the first 3 Children Link to this post

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

    953 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.