Jump to:

3444 Posts in 1030 Topics by 871 members

Template Questions

SilverStripe Forums » Template Questions » [resolved] <if Menu 2> etc...

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

Page: 1
Go to End
Author Topic: 606 Views
  • B0N35
    Avatar
    Community Member
    3 Posts

    [resolved] <if Menu 2> etc... Link to this post

    Hey there,

    Done a quick search and cannot find what I am after.

    Basically, I want a menu to output if 3 is available, but dont show menu 2.

    So something like:

    <% if Menu(3) %> Then some command here going Hide Menu 2.

    Kind Regards
    Chris

    RESOLVED WITH FOLLOWING

    <% if Menu(3) %>
       <div id="submenu">
        <ul>
    <% control Menu(3) %>
    <li class="$LinkingMode"><a href="$Link" title="Go to the &quot;{$Title}&quot; page">$MenuTitle</a></li>
    <% end_control %>
    </ul>
    </div>
       <% else %>
    <div id="submenu">
        <ul>
    <% control Menu(2) %>
    <li class="$LinkingMode"><a href="$Link" title="Go to the &quot;{$Title}&quot; page">$MenuTitle</a></li>
    <% end_control %>
    </ul>
    </div>
       <% end_if %>

    606 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.