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

hide some children on dynamic menu

Go to End



Community Member, 7 Posts

29 December 2008 at 3:06am


I have the following code which generates a dynamic menu using the children of all the pages.


<% control MainMenu %>
<li><a href="$Link">$MenuTitle.XML</a>

<% if Children %>

<ul class="submenu{$MenuCount}">
<% control Children %>
<li><a href="$Link" title="Go to the $Title.XML page">$MenuTitle</a></li>
<% end_control %>

<% end_if %>
<% end_control %>


What I want to do is only show this on a couple of the MainMenu. Question is how can I achieve this. I have tried to use ChildrenOf without any success