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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Template Questions /

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

two or more IDs on <% control ChildrenOf(right_here) ??

Go to End

2 Posts   968 Views


Community Member, 1 Post

22 April 2012 at 7:55am

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 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 =/


Community Member, 545 Posts

28 April 2012 at 2:56am

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