am-impact / amnav

Navigation plugin for Craft
168 stars 19 forks source link

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

Open johnniefp opened 8 years ago

johnniefp commented 8 years ago

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

bonzidrine commented 7 years ago

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?

terryupton commented 7 years ago

+1 for this.

admench commented 7 years ago

+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.