So I have a two-level Navigation in a structure. What I want is to give the parent of my entry (if a parent exists) the active tag.
right now I'm doing that:
{% for nav_item in navigation %}
<li class="{% if craft.request.getSegment(1) == nav_item.nav_url %}active {% endif %}{% if nav_item.hasDescendants() %}more{% endif %}">
<a href="{{nav_item.nav_url}}">{{nav_item.title}}</a>
{% if nav_item.hasDescendants() %}
<ul class="submenu">
{% for child in nav_item.getChildren() %}
<li>
<a href="{{child.nav_url}}">{{child.title}}</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
sadly most children don't share the first segment