Jump to:

4938 Posts in 16827 Topics by 1490 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Themes-nesting menus

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

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

Page: 1
Go to End
Author Topic: 1462 Views
  • StillLearning
    Avatar
    Community Member
    12 Posts

    Themes-nesting menus Link to this post

    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?

  • mccarville
    Avatar
    Community Member
    32 Posts

    Re: Themes-nesting menus Link to this post

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

  • LinseyM
    Avatar
    Community Member
    99 Posts

    Re: Themes-nesting menus Link to this post

    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!

    ;)

    1462 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.