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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

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

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

Multi Coloured Menus


Go to End


3 Posts   1698 Views

Avatar
BlueO

Community Member, 52 Posts

26 July 2008 at 5:40pm

Hi all,

I'm pretty new to this and attempting to have a differently coloured menu for each major section of my site.

I thought about creating different page types for each section but there are already several different types (forum, articles etc) in each section. This means I can't use, for example, an article page in different sections without creating yet another page type.

So... is there a simple way to call up different /include/Menu.ss files depending upon what the parent/section is?

If anyone to could point me in the right direction I'd be grateful

thanks
bernard

Avatar
Willr

Forum Moderator, 5523 Posts

26 July 2008 at 10:54pm

Theres several ways to do this. You could use something like <% if InSection(SectionName) %> - http://doc.silverstripe.com/doku.php?id=built-in-page-controls#links_and_class_s or you could do something like id="$ClassName" in your html to change colors etc as this would generate id="BlogPage" for BlogPage, id="Page" for any pages of type page then in the CSS you could use #BlogPage {} for custom styles on BlogPages

Avatar
BlueO

Community Member, 52 Posts

27 July 2008 at 11:53am

Excellent,

The

<% if InSection() %>
worked perfectly.

Thank you willr

bernard