We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38359
    • 93 Posts
    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!
      • 3109 ☆ 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.
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 38359
        • 93 Posts
        Quote from: benmarte at Nov 26, 2013, 08:48 AM
        Try using the &parentClass parameter

        Thanks for the reply but I don't think that'll work because it'll add the class to the parent li all the time, and I only want it when the child li is active.
          • 4172
          • 5,888 Posts
          can't you just change your CSS to meet your needs?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 38359
            • 93 Posts
            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!
              • 4172
              • 5,888 Posts
              you could also try to use the &activeParentRowTpl - parameter
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 28042 ☆ 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.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 38359
                  • 93 Posts
                  Quote from: sottwell at Nov 26, 2013, 11:39 AM
                  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.

                  Brilliant thankyou!