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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Drop down for subpages not showing on Nav bar


Go to End


3 Posts   2055 Views

Avatar
Rich24b

Community Member, 7 Posts

1 October 2012 at 2:29am

Edited: 01/10/2012 2:43am

I want to have a drop down for sub pages on the nav bar. I have the page visibility checked. I would think that this would generate the drop down menu under the top page displayed. I am obviously still a novice with SilverStripe. How do I create drop down menus on the navigation bar?

I am using the Cloudy Theme with SilverStripe 3.

Avatar
Liam

Community Member, 470 Posts

4 October 2012 at 2:45pm

Never used that theme before, but it seems it doesn't have it built in by default.

You have to setup the template to display child pages.

This shows just the 1st level of children.


<ul id="nav">
        <% loop Menu(1) %>
        <% if Children %>
        	<li><a href="$Link" title="Go to the $Title.XML page">$MenuTitle</a>
            	<ul>  
                <% loop Children %>               
                	<li><a href="$Link" title="Go to the $Title.XML page">$MenuTitle</a></li>
                <% end_loop %>
                </ul>            
             </li>            
         <% else %>
         	<li><a href="$Link" title="Go to the $Title.XML page">$MenuTitle</a></li>
         <% end_if %>
         <% end_loop %>
</ul>

You should then also use some type of script for browser compatibility like http://users.tpg.com.au/j_birch/plugins/superfish/

Avatar
Rich24b

Community Member, 7 Posts

8 October 2012 at 10:19am

Liam, Thank you for the response and advice on Superfish. I would have responded sooner but I haven't got back to work on that site yet. Prior to your response, I did get the sub page links displaying in the sidebar. I guess that is how the theme does it, however I had disabled the sidebar display before trying to create sub pages. I will go back to get it working with the drop down method. Thanks again, Rich