Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Multi Coloured Menus

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

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

Page: 1
Go to End
Author Topic: 1417 Views
  • BlueO
    Avatar
    Community Member
    52 Posts

    Multi Coloured Menus Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Multi Coloured Menus Link to this post

    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

  • BlueO
    Avatar
    Community Member
    52 Posts

    Re: Multi Coloured Menus Link to this post

    Excellent,

    The

    <% if InSection() %>

    worked perfectly.

    Thank you willr

    bernard

    1417 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.