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 Menus with Silverstripe


Go to End


40 Posts   20022 Views

Avatar
Valorinbattle

Community Member, 95 Posts

14 February 2009 at 8:21am

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.

Community Member, 20 Posts

14 February 2009 at 12:31pm

Hi James,

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

Avatar
Valorinbattle

Community Member, 95 Posts

14 February 2009 at 12:35pm

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

Forum Moderator, 5523 Posts

15 February 2009 at 7:17pm

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

Community Member, 95 Posts

15 February 2009 at 7:48pm

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

Forum Moderator, 5523 Posts

16 February 2009 at 9:09am

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

Forum Moderator, 5523 Posts

16 February 2009 at 9:09am

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

Community Member, 95 Posts

16 February 2009 at 10:46am

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

~ James

Go to Top