Hi there,
I'm having a bit of a head scratcher with Wayfinder so I'm hoping someone can help.
All I want to do is a the class 'activeParent' to the parent li when a child is active. By default Wayfinder adds the class 'active' to the parent when a child is active, but this is no good for me because in my CSS, 'active' means that the page itself is active, not one of its children.
Thanks for reading and I hope someone can help!
-
☆ A M B ☆
- 894 Posts
Try using the &parentClass parameter in your wayfinder call and set it to whatever it is you need it to be, more info on the
RTFM page for Wayfinder.
Good Luck.
can't you just change your CSS to meet your needs?
Yes I can but it's quite a complicated menu that took me a few hours to build and test, if there's an easy way to display the class I'd rather do that. I've been using Wayfinder for years now and TBH it never occurred to me that it didn't put an 'activeParent' class in automatically! If I can't find an answer I'll go back and change the CSS and remember for next time!
you could also try to use the &activeParentRowTpl - parameter
-
☆ A M B ☆
- 24,524 Posts
Wayfinder has the activeClass property for setting a class for the active page and its parents. It uses the selfClass property for setting a class for the active page alone. If you use both, you can use the selfClass to override the activeClass classname in your CSS with a minimum of fuss and bother.