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.

Installing SilverStripe

Getting SilverStripe up and running on your computer and on your web server.

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

Themes-nesting menus


Reply

3 Posts   1472 Views

Avatar
StillLearning

8 January 2009 at 10:27pm Community Member, 12 Posts

I have tried a few of the themes but cannot find any that seem to support sub pages of sub pages that show on the top level menus. I know I can do it with coding.... but I am in a hurry and wonder if is built in an i am missing it?

Avatar
mccarville

17 January 2009 at 11:43am (Last edited: 17 January 2009 11:44am), Community Member, 32 Posts

You want your sidebar.ss(typical name) file in themes\Theme_Name\templates\Includes\ to look something like this:

<% control Level(1) %>

<% if Children %>
      <a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode test">$Title</a>

             
      <ul class="sidemenu">
          <% control Children %>
         <li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode">$MenuTitle</a>
   
         <!--Level 2 of the Menu -->
         
         <% if LinkOrSection = section %>
         <ul class="sidemenu">
          <% control Children %>
         <li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode">$MenuTitle</a>
         
         <!-- Level 3 of the Menu -->
         
         <% if LinkOrSection = section %>
         <ul class="sidemenu">
          <% control Children %>
         <li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode">$MenuTitle</a></li>
         <% end_control %>
      </ul>
      <% end_if %>
         
         </li>
         <% end_control %>
      </ul>
      <% end_if %>
      </li>
         <% end_control %>
      </ul>

<% end_if %>
<% end_control %>

Avatar
LinseyM

5 July 2009 at 4:27am Community Member, 99 Posts

Just stumbled upon this post in the forum while trying to do the very same thing on my site!

Thanks very much mccarville - works like a charm!

;)