We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    Hi,

    Is it possible to make the Parent LI item of a child use the ON class even when the child article is hidden from menu?

    My scenario is that I have a Blog section, so I use a Wayfinder nav to create the site's primary navigation and included in this is the BLOG item - I don't want all the blog posts to list as children in the menu (e.g. as a dropdown (I am using CSS to show/hide child UL on rollover etc)) - but what I do want, is that when you view the child BLOG article - then I want the Parent BLOG item in the primary nav to render using the ON class?

    Is this possible?

    Hard to articulate the situation I have - does this make sense?

    This is the Wafinder snippet call:

    [[Wayfinder? &startId=`0`&level=`2` &excludeDocs=`32,33,34,35,36,37,42,43,44,55` &hereTpl=`PrimaryNavHereTpl` &rowTpl=`PrimaryNavTpl` &innerRowTpl=`PrimaryNavChildTpl` &innerHereTpl=`PrimaryNavChildHereTpl` &activeParentRowTpl=`PrimaryNavParentHereTpl` &ignoreHidden=`0` ]]
    [ed. note: dubbs last edited this post 14 years, 3 months ago.]
      • 22427
      • 793 Posts
      May be the &hereClass could do what you are looking for.
      Have a look into
      ottogal :: ymodx

      especially Example 1.
      See also this thread:
      https://forums.modx.com/thread/76732/a-beginner-s-tutorial-on-wayfinder-properties

        • 36404
        • 307 Posts
        hi,

        actually, i think it's more the activeClass job as it applies to all the current page parents if there is
        the hereClass applies only on the ressource you're currently viewing if i remember well

        have swing
          réfléchir avant d'agir
          • 8168
          • 1,118 Posts
          &activeClass CSS declaration was what was missing - I was not using the in-built WF Class code snippets as was self declaring the CSS in my TPLs - adding these back to the parent TPL made it work - then just added in an active CSS selector and styled up and bang all good.

          Thanks guys!