I have a list of tags on my site and want to add an active class to the linked tag based on the URL. For example, if the user is on the URL http://whatever.com/blog/by_tag/control+system+failure, I want "Control System Failure" from the list of all tags to have the active class.
I'm using this code:
{exp:tag:cloud
channel="blog_entry"
limit="25"
}
<li class="{if '{segment_3}'=='{websafe_tag}'}active{/if}">
<a href="{path='blog/by_tag'}/{websafe_tag}">{tag}</a>
</li>
{/exp:tag:cloud}
However, it doesn't work because {segment_3} displays the tag name without the + separator. For example
{websafe_tag} = control+system+failure
{segment_3} = control system failure
I've even tried using {last_url_segment} from the Current Extension, but that also produced the tag without the plus sign.
Does anyone have any ideas on how I can get the active class added?