So, I’m deep in the middle of my first EE site and have a few bumps, scrapes, and bruises, but no contusions! 😊
I’m trying to figure out how to incorporate an “active class” for the main navigation of my site.
I’ve successfully used segment_1 tag in this fashion:
<li {if segment_1=="visitors"}class="active"{/if}>But I’d like a different way if possible, because it only matches up to the url the way it’s cased exactly. For example, http://www.mydomain.com/weblog works, but http://www.mydomain.com/WEBlog doesn’t work.
I’ve tried this option:
http://ellislab.com/blog/entry/behind_the_curtain_part_one/
and
{embed="inc/.head" page_name="Visitors" loc="Visitors"}was put in the index file of the weblog
and
<li {if '{embed:loc}' == 'visitors'}class="active"{/if}>was inserted in the <li>.
But I can’t get it to work. 😏
Yes, I’ve tried capitalized “Visitors” and lowercase “visitors” which made no difference.
Yes, the CSS code and HTML works with static content and validates 100% as XHTML strict.
Any thoughts as to why this option won’t work?