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

Staff Page ***SOLVED***

Go to End

4 Posts   845 Views


Community Member, 14 Posts

23 January 2012 at 3:25pm

Sorry if this has been covered, but i couldn't find it...

I've created a page that lists all the staff etc on one page (based on tutorial.

The staff page is all good but i would like each staff member to be listed under their role, basically like how Silverstripe have done it with their team page

So CEO, Development, Design etc etc

Can someone point me in the right direction on what documentation i have to read up on?




Community Member, 175 Posts

24 January 2012 at 8:34am


you should have a own field for the role, right?

so just generate a own dataobject with a special filter (SQL), where the result is such a listing ...


make a function in Page.php -> StaffMembers($role)

and in template you can call StaffMembers(CEO) to get the boss or StaffMembers(Devs) to get all the Developers

<% if StaffMembers(Devs) %>
<% control StaffMembers(Devs) %>
<% end_control %>
<% end_if %>


Community Member, 26 Posts

24 January 2012 at 9:29am

Edited: 24/01/2012 9:30am

<% control StaffMembers.GroupedBy(Role) %>
	<% control Children %>
	<% end_control %>
<% end_control %>

or if Role is an object (has_one):
... GroupedBy(RoleID) [...] <h2>$Role.Title</h2> ...


Community Member, 14 Posts

24 January 2012 at 9:54am

Thanks for the replies guys, i've got it to work now!

i was close but i was using <% control StaffMembers.groupBy(Role) %> so Plato's suggestion (.GroupedBy) worked a treat

thanks again