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

[resolved] <if Menu 2> etc...


Go to End


1021 Views

Avatar
B0N35

Community Member, 3 Posts

5 July 2011 at 12:34pm

Edited: 05/07/2011 1:16pm

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