Active class in nav menu

I am trying to setup an internal menu (e.g. “about us | Team | Else” that works with dynamic routing where they share the same about template:

  /about/team/:
    template: about
    data: page.team

to facilitate the user navigation, i would like to set an active class in the template file (team.hbs) that activate the menu element relevant to the navigation (eg: “about us | Team | Else”).

I have tried something like that:

<p class="{{#if current}} active {{/if}}">{{t "About us"}}</p>

I am in the hope that someone can help me correcting this code.

Hi @tadartefactorist. So sorry about the delay in response. We’ve recently introduced a helper just for this kind of situation:

<p class="{{link_class for="/about/" activeClass="active"}}">About</p>

Which will output when on the About page:

<p class="active">About</p>

We’ll be putting up some more extensive documentation very soon.

Hope this helps!