Jump to:

1347 Posts in 439 Topics by 514 members

Themes

SilverStripe Forums » Themes » Section/Current CSS menue styles

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 1577 Views
  • nzjoel
    Avatar
    Community Member
    26 Posts

    Section/Current CSS menue styles Link to this post

    Hey Everyone. I am trying to use the 'section' css style for buttons that are selected and have children. For all other buttons that are selected I want them to use the 'current' css style. Can anyone help me?

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Section/Current CSS menue styles Link to this post

    $LinkOrSection will return 'link' for a general page or 'section' if you're on the current page or a child page. If you could adapt your css to use those class names that would be the best way.

    <a href="$Link" class="$LinkOrSection">...

  • nzjoel
    Avatar
    Community Member
    26 Posts

    Re: Section/Current CSS menue styles Link to this post

    I have attached 2 examples and how i want them to look.

    The one with Welcome selected has no children and therefor looks different to when International Exchanges is selected in example 2. International Exchanges has children and therefor has a different BG image which has a matching grey colour behind the button so that it looks like the bg of children goes up and behind the parent button image. Hope you get what im meaning.

    Help would be greatly appreciated.

    Attached Files
  • nzjoel
    Avatar
    Community Member
    26 Posts

    Re: Section/Current CSS menue styles Link to this post

    Sorted it.
    <a href="$Link" title="$Title.XML" class="$LinkOrSection <% if Children %>ChildrenClass<% end_if %>">

    Works now. Thanks

    1577 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.