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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

hide some children on dynamic menu


Go to End


3559 Views

Avatar
pinkdigital

Community Member, 7 Posts

29 December 2008 at 3:06am

Hi

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

<ul>

<% 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 %>
</ul>

<% end_if %>
<% end_control %>
</li>

</ul>

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

HELP!