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.

Archive /

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

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

navigation styling


Go to End


3 Posts   1462 Views

Avatar
RR_EHV

Community Member, 2 Posts

7 October 2008 at 1:57am

Edited: 07/10/2008 7:51am

Hi all,

I'm having some trouble styling a specific element in the navigation.

This is generated:

<li><a href="/subscribe/" title="Go to the Subscribe page" class="link">Subscribe to newsletter</a></li>

How am i able to add more to the class, so i can style it with the CSS files?

Thanks for any help!

Avatar
ajshort

Community Member, 244 Posts

7 October 2008 at 2:34am

RR_EHV,

you could use something like the following: it adds an extra class if the current link has the URL of "subscribe".

<li><a href="$Link" title="Go to the $Title.XML page" class="link <% if URLSegment = subscribe %>subscribe-link<% end_if %>">$MenuTitle</a></li>

Avatar
RR_EHV

Community Member, 2 Posts

7 October 2008 at 7:51am

Works like a charm.
Much obliged...