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.

General Questions

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

Drop Down Menus with Silverstripe


Go to End
Reply

40 Posts   14865 Views

Avatar
Valorinbattle

14 February 2009 at 8:21am Community Member, 95 Posts

I am trying to integrate a dropdown menu with a Silverstripe install. I see many posts about cssplay.co.uk and cssmenus.co.uk
I really like what they've developed over there but have no idea whatsoever on how to integrate that into Silverstripe.

I see that some of you have successfully done it and was wondering if I could get some help.
Thanks!

~ James

Avatar
D.K.

14 February 2009 at 12:31pm Community Member, 20 Posts

Hi James,

You will have to do some template coding, but here's a link: http://silverstripe.org/archive/show/15257.

Avatar
Valorinbattle

14 February 2009 at 12:35pm Community Member, 95 Posts

D.K. thanks for your reply. I reviewed that link previously and I don't understand it. What template do I put that info into and do I reference it in all my page.ss, homepage.ss, etc?

Thanks for your help!

~ James

Avatar
Willr

15 February 2009 at 7:17pm Forum Moderator, 5511 Posts

Are you talking about a dropdown menu (like navigation) or a dropdown select form? I use the CSSPlay menus alot on my projects. Like californiawomen.org. I have attached an example Menu1.ss (the html needed) and Menu.css ( the css needed for it). You can just place the Menu.ss in yourtheme/templates/Includes/* and include it in your theme with <% include Menu1 %>. The CSS you can copy and put in your own CSS file or include this file seperatly

I haven't attached all the images etc and you might need to tweak the styles for your project but should be a start for you.

Avatar
Valorinbattle

15 February 2009 at 7:48pm Community Member, 95 Posts

Will, thank you for the reply. And for sharing your files!
So, I add the css to my css.
As for the menu1.ss, I add that to mytheme/templates/includes/
And you say to add it into my theme with <% include Menu1 %>
This last part is what I'm not sure how to do.
I have two page.ss files.
The first is in mytheme/templates/page.ss
The second is in mytheme/templates/layout/page.ss
What do I add to each of these page.ss files?

Thanks again for your help Will!
Very much appreciated.

~ James

Avatar
Willr

16 February 2009 at 9:09am Forum Moderator, 5511 Posts

well you put the <% include %> whereever you want the menu in your theme. Have a read of the first 2 tutorials so you understand the basics of the templates. Usually you would put that include in templates/Page.ss.

Avatar
Willr

16 February 2009 at 9:09am Forum Moderator, 5511 Posts

well you put the <% include %> whereever you want the menu in your theme. Have a read of the first 2 tutorials so you understand the basics of the templates. Usually you would put that include in templates/Page.ss.

Avatar
Valorinbattle

16 February 2009 at 10:46am Community Member, 95 Posts

Thank you Will. Everything's working great for me now - I appreciate your help!

~ James

Go to Top