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.

Themes

Discuss SilverStripe Themes.

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

Sub-Sub-Menues


Reply

6 Posts   1116 Views

Avatar
Lone_Deranger

4 February 2011 at 12:58pm Community Member, 3 Posts

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?

Avatar
Invader_Zim

5 February 2011 at 12:31pm (Last edited: 5 February 2011 12:41pm), Community Member, 141 Posts

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 [url=http://silverstripe.org/fancypants-theme/]Fancypants theme[/url].

Cheers,
Christian

Edit: ^^Oh man, I suck at formatting code in forums, see it [url=http://pastie.org/1529897]here again[/url] in a nicer version :-) Doh

Avatar
Lone_Deranger

9 February 2011 at 5:21am Community Member, 3 Posts

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

Avatar
Invader_Zim

9 February 2011 at 5:53am Community Member, 141 Posts

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

Avatar
SerenityIT

4 March 2011 at 12:24am Community Member, 13 Posts

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

Avatar
3dgoo

21 March 2011 at 5:31pm Community Member, 133 Posts

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