We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
Setting list navigation class based on CSS friendly page title
I'm trying to set list classes within the stock navigation item template based on the page title, however, I can't see an easy way either to add a new custom page details field or to call PHP functions such as substring and strtolower to build a list class based on the page title.
Could you please advise the best approach to achieve this?
I've also tried setting an ID for each list item via the slug attribute, however, this doesn't seem to work.
<li<perch:if exists="current_page"> class="active"</perch:if> id="test-<perch:content id="slug" type="slug" for="heading" />" <perch:if exists="ancestor_page"> class="ancestor"</perch:if>>
Apologies if this has been answered on the forum. I couldn't see anything relevant.
Want to reply to this thread?Login with Perch