I'm looking for a way to designate the top-level link as active (or current, or whatever you prefer to name it) when one of it's children is the current page.

Here's a pretty standard dropdown nav snippet:

{{ nav from="/" max_depth="2" exclude="jobs" }}
  <li class="divider"></li>
  <li class="{{ if is_current }}active {{ endif }}{{ if children }}has-dropdown {{ endif }}">
    <a href="{{ if children}}#{{ else }}{{ url }}{{ endif }}">{{ title }}</a>
    {{ if children}}
      <ul class="dropdown">
      {{children}}
        <li><a href="{{ url }}">{{ title }}</a></li>
      {{/children}}
      </ul>
    {{ endif }
  </li>
{{ /nav }}

How can I mark the top-level <li> elements with a class of active if one of it's children is the current page?

Answered by Jason Varga! Go to answer.