Skip to content

Instantly share code, notes, and snippets.

@sheadawson
Created September 18, 2012 04:08
Show Gist options
  • Save sheadawson/3741198 to your computer and use it in GitHub Desktop.
Save sheadawson/3741198 to your computer and use it in GitHub Desktop.
Silverstripe nested navigation
<ul id='nav'>
<% control Menu(1) %>
<% if Children %>
<li id='nav-$ID' class="$LinkingMode $FirstLast">
<a href="$Link">$MenuTitle</a>
<ul class="submenu $LinkingMode">
<% control Children %>
<% if Children %>
<li id='nav-$ID' class="$LinkingMode $FirstLast">
<a href="$Link">$MenuTitle</a>
<ul>
<% control Children %>
<li id='nav-$ID' class='$LinkingMode $FirstLast'>
<a href="$Link">$MenuTitle</a>
</li>
<% end_control %>
</ul>
</li>
<% else %>
<li id='nav-$ID' class='$LinkingMode $FirstLast'>
<a href="$Link">$MenuTitle</a>
</li>
<% end_if %>
<% end_control %>
</ul>
</li>
<% else %>
<li id='nav-$ID' class="$LinkingMode $FirstLast">
<a href="$Link">$MenuTitle</a>
</li>
<% end_if %>
<% end_control %>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment