Jump to:

3393 Posts in 976 Topics by 852 members

Template Questions

SilverStripe Forums » Template Questions » hide some children on dynamic menu

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

Page: 1
Go to End
Author Topic: 2296 Views
  • pinkdigital
    Avatar
    Community Member
    7 Posts

    hide some children on dynamic menu Link to this post

    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!

    2296 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.