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

Select Sub Page to display in parent page

Go to End

2 Posts   1319 Views


Community Member, 78 Posts

3 June 2011 at 8:36pm

Hi there,

I have the following page tree:

1. Province
- Activities
-- activity one
-- activity two
-- activity three

- Activities
-- activity one
-- activity two
-- activity three

I would like to select all page under activities belong to all projects to display
within page parent page province.

Could you please let me know if there is any trick.



Community Member, 38 Posts

7 June 2011 at 10:01pm

Put the following function in your Province controller:

function ActivitiesList() {
$records = DataObject::get("Activity"); // assuming Activity is the right classname for your activity pages

Now you can list all your activities in your Province theme file with a simple control.

<% control ActivitiesList %>
<% end_control %>

Hope this helps.