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.

Migrating a Site to Silverstripe /

What you need to know when migrating your existing site to SilverStripe.

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

How to set up Sub-sub-menu to my site??


Reply


2 Posts   2037 Views

Avatar
justcomde

Community Member, 2 Posts

18 August 2009 at 3:09am

Edited: 18/08/2009 3:10am

Hello everyone,

i was asking myself how to implement a sub-sub-menu to my site. I am quite new to silverstripe and don't know how to do that.

This is how the actual sub-menu is looking:

<% if Menu(2) %>
<div id="Menu2Top">
<% control Level(1) %>
<h2><a href="$Link">$Title</a></h2>
<% end_control %>
</div>
<ul id="Menu2">
<% control Menu(2) %>
<li class="$LinkingMode"><a href="$Link" title="$Title">$MenuTitle</a></li>
<% end_control %>
</ul>
<% end_if %>

What do i need to do?

I tried this one here, but didn't work out:

<% if Menu(2) %>
<div id="Menu2Top">
<% control Level(1) %>
<h2><a href="$Link">$Title</a></h2>
<% end_control %>
</div>
<ul id="Menu2">
<% control Menu(2) %>
<li class="$LinkingMode"><a href="$Link" title="$Title">$MenuTitle</a>
<% if Children %>
<ul>
<% control Children %>
<li class="$LinkingMode"><a href="$Link" title="$Title.XML">$MenuTitle</a></li>
<% end_control %>
</li>
<% end_control %>
</ul>
<% end_if %>

Am I missing something? Anyone got a clue how to make it work?

Thanks in advance,

m-obi

Avatar
justcomde

Community Member, 2 Posts

18 August 2009 at 3:34am

I tried a little harder and came to THE solution. For anyone who has the same problems, just do it this way:

<% if Menu(2) %>
<div id="Menu2Top">
<% control Level(1) %>
<h2><a href="$Link">$Title</a></h2>
<% end_control %>
</div>
<ul id="Menu2">
<% control Menu(2) %>
<li class="$LinkingMode"><a href="$Link" title="$Title">$MenuTitle</a>
<% if Children %>
<ul>
<% control Children %>
<li class="$LinkingMode"><a href="$Link" title="$Title">$MenuTitle</a></li>
<% if LinkOrSection = section %>
<% if Children %>
<% end_if %>
<% end_if %>
<% end_control %>
</ul>
<% end_if %>
</li>
<% end_control %>
</ul>
<% end_if %>