Jump to:

1347 Posts in 439 Topics by 514 members

Themes

SilverStripe Forums » Themes » Sub-Sub-Menues

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 1045 Views
  • Lone_Deranger
    Avatar
    Community Member
    3 Posts

    Sub-Sub-Menues Link to this post

    Hi,

    I am new to Silverstripe and pretty new to cms in general.

    I managed to install Silverstripe and I have played around with the default theme blackcandy.
    I installed a couple of other themes; however, none of them seem to be able to display sub-submenues the way the default theme does. I like how I can have several categories. (A grandparent page, a parent page and the actual page.) Unfortunatey. no theme I found can do this.

    Am I doing something wrong?
    Are there themes that can display sub-sub-pages?

  • Invader_Zim
    Avatar
    Community Member
    141 Posts

    Re: Sub-Sub-Menues Link to this post

    Hi.

    I use this snippet (<THEME>/templates/Includes/SideBar.ss) to handle Pages->SubPages->SubSubPages:

    <% if Menu(2) %>
    <nav id="SideBarNav" class="secondNav">
    <ul>
    <% control Menu(2) %>
    <li class="$LinkingMode"><a href="$Link">$MenuTitle</a>
    <% if LinkingMode != link %>
    <% if Children %>
    <ul class="thirdNav">
    <% control Children %>
    <li class="$LinkingMode"><a href="$Link">$MenuTitle</a></li>
    <% end_control %>
    </ul>
    <% end_if %>
    <% end_if %>
    </li>
    <% end_control %>
    </ul>
    </nav>
    <% end_if %>

    It's a little bit modified, but if my mind doesn't fool me, the original code is from the wonderful Fancypants theme.

    Cheers,
    Christian

    Edit: ^^Oh man, I suck at formatting code in forums, see it here again in a nicer version Doh

  • Lone_Deranger
    Avatar
    Community Member
    3 Posts

    Re: Sub-Sub-Menues Link to this post

    Thanks.
    I will try this. Do I just copy&paste it into the Sidebar.ss File? Or do I have to replace something?

  • Invader_Zim
    Avatar
    Community Member
    141 Posts

    Re: Sub-Sub-Menues Link to this post

    Japp, it goes to Sidebar.ss.
    It depends on the rest of your theme, if you break your layout by just replacing existing code with above snippet.
    But i think it is save to copy&paste it in and see what happens .

    One note, this snippet uses <nav></nav> tags (Html5) and you might want to replace them with <div></div> tags if you are using another doctype.

    Cheers,
    Christian

  • SerenityIT
    Avatar
    Community Member
    13 Posts

    Re: Sub-Sub-Menues Link to this post

    Hi, I am also new to this CMS software.

    I'm attempting to port across our intranet into this as an example to replace our existing dotnetnuke intranet.

    I'm having a similar issue but my menus need to go 1 level deeper so for example

    Brands -> Brand name -> Hotels -> Hotel name

    Currently no theme supports this, is there some code I can implement into a custom theme (which I assume will be what will be made if this goes ahead) to support this many levels?

    Thanks

    Andy

  • ampedup
    Avatar
    Community Member
    133 Posts

    Re: Sub-Sub-Menues Link to this post

    Hi Andy,

    You can edit any theme to make the menus go as deep as you want, you just need to code it up.

    The current menu is probably in the SideBar.ss include template. If you want to past the current SideBar code, I'll happily post back what you need to have deeper levels of menus.

    Then you would just need to edit the styling of the page in Layout.css.

    Cheers,

    Bob

    1045 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.