I’m trying to make sense of WayFinder... I succesfully made a navigation for my ’main’ categories, but I’ve also got subcategories that have specific markup.
I’m confused as to how I could achieve the following in WayFinder:
- The class ’activepage’ gives the background for the main section a different style (background color)
- each subsection gets a class ’subpage’ ; this styles it a bit differently (e.g. indentation) to differentiate it from its main section
- in the currently ’active’ subsection (actual page you are on), the menu link gets the class ’active’
So to recap:
* the current ’main section’ should get class ’activepage’ in its listitem
* all subsections of the current ’main section’ should get class ’subpage’ in their list items
* the menu link representing the current page inside of the ’subsections’ should get class ’active
Remark: There will only be one ’main section’ that has subsections on a particular page. So there are no multiple main sections+subsections on the same page.
Edit: after thinking it over, because it’s not such a big website, it would be acceptable for me if I had to give the menu link a class myself using e.g. an html editor or the Modx Quick-Editor. I figured out the code to add ’activepage’ (using chunks), so that just leaves putting the ’subpage’ class on the list items that immediately follows the list item with class ’activepage’ .
However, the program has no way of knowing how many subitems there are, so perhaps I should consider re-writing my code and use a nested list for the subsections?
Below the code:
<div id="rightcol">
<ul id="nav">
<li><a href="/.">Home</a></li>
<li class="activepage"><a href="/about /">About Us</a></li>
<li class="subpage"><a class="active" href="mission.php">Our Mission</a></li>
<li class="subpage"><a href="history.php">History</a></li>
<li><a href="/infrastructure/">Infrastructure</a></li>
<li><a href="/products/">Products</a></li>
<li><a href="/promotion/">In Promotion</a></li>
<li><a href="/documentation/">Documentation</a></li>
<li><a href="/contact/">Contact</a></li>
<li><a href="../contact/guestbook.php">Guest Book</a></li>
</ul>
</div>
P.S. : Hi!