Pulse

Can Pulse dynamically add an active class to a link?

Todd
http://xiiro.com


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I don’t know about Pulse particularly, but you could do this with JavaScript very simply. You can compare the href of a link with the window.location.pathname and see if there is a complete or partial match, and change the classname if there is.

Walter

On Jan 22, 2014, at 1:41 PM, Todd wrote:

Can Pulse dynamically add an active class to a link?

Todd
http://xiiro.com


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Todd,
No but here is how I did it on this site;
http://myconcierge.org.uk

At the top of each page I inserted the following PHP and inserted a suitable slug name;

<?php $page_slug = "testimonials"; ?>

I then added the following code to the body tag in the header.php file (template/header.php);

This simply echoes the page slug as an ID on the body tag.

In my CSS stylesheet I can now add this which adjusts the style of the navigation bar item when viewed on it’s own page;

#testimonials a.testimonials {
background-color:#f3f3f3;
border-top:5px solid #08c;
}

I keep meaning to email Mark or Ulli over at Pulse to see if they can add this into Pulse by default as I find it really useful.
Regards,
Tim.

On 22 Jan 2014, at 18:41, Todd wrote:

Can Pulse dynamically add an active class to a link?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Nice. Thanks Tim and Walter.

Todd
http://xiiro.com


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options