Jump to:

3445 Posts in 1031 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » two or more IDs on <% control ChildrenOf(right_here) ??

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

Page: 1
Go to End
Author Topic: 570 Views
  • arthgwyr
    Community Member
    1 Post

    two or more IDs on <% control ChildrenOf(right_here) ?? Link to this post

    Hi, I'm new on SilverStripe, and I want to use it on my portfolio, I'm a webdesigner
    I have this structure:

    I'm using a custom subtemplate for HOME and I want it to display a grid or table with all the projects I have done:

    1 2 3 a b
    c i ii iii

    is there a page control to get all the grandchildren from "Projects", I've read http://doc.silverstripe.org/sapphire/en/reference/built-in-page-controls but I couldn't find anything, also I want them to apear in random order, that's why I'm looking for one instruction instead of writing:

    <% control ChildrenOf(__________)%>

    for every grandchildren in order to achieve it


    and sorry for my really lame english =/

  • zenmonkey
    Community Member
    528 Posts

    Re: two or more IDs on <% control ChildrenOf(right_here) ?? Link to this post

    You'd need to do <% control ChildrenOf("Projects") %> <% control Children %> Your COde <% end_control %><% end_control %>

    Remember once you're in a control loop any method available to that control are exposed. So once you're in ChildrenOf("Projects") anything available on Project is available to you

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.