am-impact / amnav

Navigation plugin for Craft

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make parent 'active' but only on the structure the current node is on.

johnniefp opened this issue · comments

Hello Hubert,

Any idea how I could change your published macro 'addNodeToNavigation' to only make the current structures parent active.

I have child entries that repeat through my menu and it's leading to multiple active classes.

It's leading to things like this: (purple have class of 'active')
bar

(effectively : does amnav give me a way of the parent menu item knowing it has a specific child that's 'current' for that parent node only so as not to trigger multiple 'active' classes.)

Thanks
John

We also have the same issue on several projects. Would love to see another example of this. Maybe some other tags we can use that are not mentioned in the docs / Github?

+1 for this.

+1 for this.

It may help you if I explain my situation, I have the following menu:

screen shot 2017-03-16 at 17 35 31

If I navigate to any child of Services, the child takes the active class but the parent doesn't. However if I navigate to a page which is under Learn, both Learn and the child take on the active class. As you see, children of Learn have different URL structures to the more simple services/moderation for example.

Thanks so much for a fantastic plugin.