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.

Themes /

Discuss SilverStripe Themes.

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

Section/Current CSS menue styles


Reply


4 Posts   1707 Views

Avatar
nzjoel

Community Member, 26 Posts

17 January 2010 at 11:36pm

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?

Avatar
Willr

Forum Moderator, 5513 Posts

18 January 2010 at 9:16am

$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">...

Avatar
nzjoel

Community Member, 26 Posts

18 January 2010 at 11:42am

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
Avatar
nzjoel

Community Member, 26 Posts

18 January 2010 at 6:22pm

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

Works now. Thanks