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

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


Go to End


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