We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1972
    • 15 Posts

    Hi there,

    Say I have a site with the following hierarchy:

    +Parent A (container)
    - Child A1
    - Child A2
    - Child A3
    +Parent B (container)
    - Child B1
    - Child B2
    - Child B3
    +Parent C (container)
    -Child C1
    -Child C2

    Let’s say in my footer, I use Wayfinder to always display all the Parents (no children submenus):

    Parent A | Parent B | Parent C

    When a user goes to one of the child pages, I am hoping to be able to highlight its parent, eg, user selects Child B1, the footer would look like:

    Parent A | Parent B | Parent C

    Is there a Wayfinder param and here template I can use?

    thanks!
    Steve
      • 867
      • 241 Posts


      I think there is something like an "here class" /selected. Look at some exemple and the css you will find .

      Hope it help.
        • 1972
        • 15 Posts
        Hi alchime,

        thanks for speedy reply. I tried &hereClass and &parentClass after your suggestion, but it doesn’t appear to work, eg, in the snippet call:

        [!Wayfinder? ... &hereClass=`selected` &parentClass=`selected`!]

        and in the stylesheet:

        .selected { font-weight: bold; }

        but no luck ... when I’m on a child page, the parent folder link’s style in the footer doesn’t change. Any other suggestions or am I using the wrong syntax?

        thanks,
        Steve
          • 4310
          • 2,310 Posts
          li.selected a { font-weight: bold; }

          Should do it.
            • 1972
            • 15 Posts

            thanks for everyone’s feedback, but I still can’t get this hereClass param to work -- though it’s description seems to be exactly what I’m looking for. Is Wayfinder supposed to add the value of hereClass param as a class attribute to the <a> tag (I’m not seeing any changes in the HTML)?

            I’m including the Wayfinder call and output chunks/templates below with the hopes that someone can see what I’m not doing right.

            Wayfinder call:
            [!Wayfinder?&startId=`0` &level=`1` &outerTpl=`footer_menu_outer_tpl` &rowTpl=`footer_menu_row_tpl` &excludeDocs=`[(site_start)]` &hereClass=`activeLink`!]


            footer_menu_outer_tpl:
            [+wf.wrapper+]


            footer_menu_row_tpl:
             | <a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>


            stylesheet (I included the ’activeLink’ class in the site’s main style sheet rather than specifying a cssTpl param):
            .active, .activeLink {
                font-weight: bold;
            }

              • 7231
              • 4,205 Posts
              You are missing the class placeholder in your rowTpl so WF has no place to output the class information. Add [+wf.classes+] to the TPL where the class should show:

               | <a [+wf.classes+] href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 1972
                • 15 Posts

                Thanks dev_cw (and all contributors). That was the ticket!