Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Drop down for subpages not showing on Nav bar

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

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

Page: 1
Go to End
Author Topic: 711 Views
  • Rich24b
    Avatar
    Community Member
    7 Posts

    Drop down for subpages not showing on Nav bar Link to this post

    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.

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Drop down for subpages not showing on Nav bar Link to this post

    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/

  • Rich24b
    Avatar
    Community Member
    7 Posts

    Re: Drop down for subpages not showing on Nav bar Link to this post

    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

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