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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Themes /

Discuss SilverStripe Themes.

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

Sub-Sub-Menues


Go to End


6 Posts   2114 Views

Avatar
Lone_Deranger

Community Member, 3 Posts

4 February 2011 at 12:58pm

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

Community Member, 141 Posts

5 February 2011 at 12:31pm

Edited: 05/02/2011 12:41pm

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

Avatar
Lone_Deranger

Community Member, 3 Posts

9 February 2011 at 5:21am

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

Community Member, 141 Posts

9 February 2011 at 5:53am

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

Community Member, 13 Posts

4 March 2011 at 12:24am

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

Community Member, 135 Posts

21 March 2011 at 5:31pm

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