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:

Archive /

Our old forums are still available as a read-only archive.

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

Displaying pages where "Show in menus?" unticked

Go to End

3 Posts   1626 Views


Community Member, 153 Posts

22 October 2007 at 2:42pm


On my current project I have created Staff Pages. Instead of clicking these items for more details, i am listing all details in the template for the Page Holder. Becauce of this, I do not want these items to list in the menu at the side of the page.

However if I untick the "Show in menus?" option for each page, the details are not shown by the Page Holder template. I am using <% control Children %> to iterate through each of the Staff pages.

Can anyone assist?




Forum Moderator, 922 Posts

22 October 2007 at 8:11pm

Edited: 22/10/2007 8:16pm

Hi there,

By default, Children displays pages if the field ShowInMenus is 1.

You can override this behaviour by making your own custom control. On the class for your staff pages, or on Page (dependent on how you've setup your project), you can make a function like this:

function StaffPages() {
return DataObject::get('StaffPage', "ParentID = $this->ID");

Then replace <% control Children %> with <% control StaffPages %> - bear in mind this is assuming you have StaffPage page types assigned to your staff pages. Just change the first parameter to 'Page' if you want to get any page type as children instead.

Hope this helps!



Community Member, 153 Posts

22 October 2007 at 8:50pm

Thanks as always, Sean!