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.

Archive /

Our old forums are still available as a read-only archive.

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

Drop-down menus for SS


Go to End


3 Posts   2164 Views

Avatar
PeteF

Community Member, 8 Posts

12 November 2008 at 5:56am

Hi guys

I was just wondering, I've just found SS today. It looks like an incredibly powerful system which I would like to start specialising in using/deploying.

I've looked through some of the demo sites that are online and I can't find anyone that had implemented a drop-down menu for their main menu. I was wondering if anyone has managed to get a menu like this implemented successfully. I'm guessing if I can find a drop-down menu that is based upon using a UL structure in order to build the various tabs, it could be easily implemented.

Does anyone have any idea of how this could be achieved and has anyone got any examples of a successful implementation?

Cheers
Pete Fernando

Avatar
Liam

Community Member, 470 Posts

12 November 2008 at 6:26am

Yes it is possible.

Here is my code that is a very basic 1 level drop down. You can customize it all you want to add more levels. I personally use son of suckerfish for the css/javascript, though the below is a basic html list.

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

Avatar
Nivanka

Community Member, 400 Posts

16 November 2008 at 6:43am

if you need any examples, check the template I did for SilverStripe

http://www.silverstripe.com/hairdresser/