Hello again SilverStripe world,
I'm using the following code to pull the first level of my Nav:
<ul>
<% control Menu(1) %>
<li><a class="$LinkingMode" href="$Link" title="Go to the "{$Title}" page">$MenuTitle</a></li>
<% end_control %>
</ul>
Pretty straight forward. I need now to go a step further and also have it pull my level 2 items if they exist. Here is what in my mind should work:
<ul>
<% control Menu(1) %>
<li><a class="$LinkingMode" href="$Link" title="Go to the "{$Title}" page">$MenuTitle</a>
<% if Menu(2) %>
<ul>
<% control Menu(2) %>
<li class="$LinkingMode"><a href="$Link" title="Go to the $Title page">$MenuTitle</a></li>
<% end_control %>
</ul>
<% end_if %>
</li>
<% end_control %>
</ul>
Is this the best way to go about doing this? Of course coupled with the right css to make drop drop down show or hide.
thanks!