I’m oh so close but have had no luck yet in figuring out this bit for section navigation. I need to highlight a menu item as active or not (set class=“active” to the current page location), for content items (entries) within a weblog (no categories used).
Here is the code for the menu:
<ul>
{exp:weblog:entries weblog="sec_about" dynamic="off" orderby="sort_order" sort="asc"}
<li><a href="http://{url_title_path=content/about}">{title}</a></li>
{/exp:weblog:entries}
</ul>This menu outputs the following html:
<ul>
<li><a href="http://domain.com/index.php/content/about/company/">About the Company</a></li>
<li><a href="http://domain.com/index.php/content/about/members/">About the Members</a></li>
<li><a href="http://domain.com/index.php/content/about/contact/">Contact Us</a></li>
</ul>I’m assuming, perhaps incorrectly, that looking at segment_3 is the way to build a conditional statement to apply a class to the correct link. I am open to being wrong on that issue, however. 😉 I just can’t figure out exactly how to access the segment and compare it to the current location.
I have correctly built conditionals for the main site nav that highlights the current section of the site, but can’t figure out this section navigation. The method I used for the main site navigation used a “location” variable fed to the conditional via the template used. Since all the entries here would be using the same template, that method won’t work here.