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.

Archive

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

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

Drop-down menus for SS


Reply

3 Posts   1239 Views

Avatar
PeteF

12 November 2008 at 5:56am Community Member, 8 Posts

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

12 November 2008 at 6:26am Community Member, 470 Posts

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

16 November 2008 at 6:43am Community Member, 395 Posts

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

[url]http://www.silverstripe.com/hairdresser/[/url]