We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25663 MODX Staff
    • 12,272 Posts
    Just to add to my problem, the active class isnt being applied to the "a" tag on a parent that has a childredirect snippet being applied to?
    I don’t see any parent levels in your sample output.
      Ryan Thrash, MODX Co-Founder
      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • 22969
      • 158 Posts
      They are the parents listed above, the children of "Our Work" is displayed at a different place on the page hence not in the code above smiley

      So just to summarise when i click on the "Our Work" which gets redirected to the first child, the "active" doesn’t appear within the "a" tag on the parent (Our Work) but instead appears in the "li"

      Brett
        • 16183
        • 1,390 Posts
        There’s at least two ways you can go about this as far as I can see:

        1. The "convoluted way" - the class "active" that WF applies by default to the current menu item and each of its parent items comes from the parameter &hereClass. So, you can specify in your WF call a different class for this or none at all e.g.

        &hereClass=`here` OR &hereClass=``


        2. The "shorter way" - just give the <a> in your hereTpl a different class name, e.g. "current"

        <li class="[+wf.classnames+]"><a class="current">[+wf.linktext+]</a></li>


        Since the hereTpl is only applied to the current item, you probably don’t need to apply classes to the <li> since you are only interested in styling the <a>, true? so, you could remove them and have something like Ryan pointed above:

        <li><a class="current">[+wf.linktext+]</a>[+wf.wrapper+]</li>


        You obviously need to add the appropriate WF placeholders to the hereTpl chunk if you want it to be clickable, otherwise, no use in using the <a> tags wink

        As for you other question, I have never used that snippet, sorry.

        cheers/k
          • 25663 MODX Staff
          • 12,272 Posts
          Look at the &parent-related templates too. Your solution probably lies in there, though I’m not sure on the split navigation front.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 22969
            • 158 Posts
            After playing round I realised that i was being fricking stupid!!

            Just changed to this in my CSS:

            #navigation li.active a {
            color: #77A9A1;
            text-decoration: underline;
            }

            Thanks anyway guys, at least i have a better understanding of the templates/chunks for wayfinder!!

            Really appreciate your efforts on this!

            Brett
              • 22673
              • 72 Posts
              Hi guys,

              I have a problem with getting the active class to work too. Its probably a simple fix though as I am only starting out with MODx and WF.

              I have followed rthrash’s instructions as posted previously but it’s not working. I think its because my WF menu is getting its CSS from the div which it is contained in. It is inside a div called "menu", here is the CSS (from the site’s CSS):

              #menu {
              width:800px;
              margin:0 auto 0 auto;
              height:40px;
              }
              #menu ul {
              padding:0;
              margin:0;
              list-style: none;
              text-align:left;
              }
              #menu li {
              float:left;
              }
              #menu li a {
              margin:7px 8px 0 0;
              float:left;
              display:block;
              padding:5px;
              text-decoration:none;
              font-size:12px;
              color:#fff;
              font-family:Verdana, Arial, Helvetica, sans-serif;
              font-weight:bold;
              }
              #menu li a:hover {
              border-bottom:#fff 2px solid;
              }
              


              Then I have added the WF code into my site template:

              <div id="menu">
              [[Wayfinder? &startId=`0` &hereTpl=`ActiveLink`]]
              </div>


              Added the chunk called "ActiveLink":

              <li><a class="active-link">[+wf.linktext+]</a></li>


              And added this to my site’s CSS:

              #active-link {
              border-bottom:#fff 2px solid;
              }


              The site in question is: www.callauto.co.uk

              Is the problem the website’s CSS and WF’s CSS clashing? Where does the default WF call its CSS from? Is it from a file here: assets\snippets\wayfinder\examples\cssplay

              Any help would be much appreciated.

              Alex.
                • 16183
                • 1,390 Posts
                Hi,

                This CSS "is not correct"

                #active-link {
                border-bottom:#fff 2px solid;
                }


                That is referencing an id while you want to reference a class. It should be

                .active-link {
                border-bottom:#fff 2px solid;
                }


                If you want/need to be even more specific then...

                a.active-link {
                border-bottom:#fff 2px solid;
                }


                Is the problem the website’s CSS and WF’s CSS clashing? Where does the default WF call its CSS from? Is it from a file here: assets\snippets\wayfinder\examples\cssplay

                WF has no default CSS smiley

                cheers/k
                  • 22673
                  • 72 Posts
                  Aaaah I told you it would be a simple fix but didnt realise it was as simple as that!!!

                  Thanks a lot smiley
                    • 16183
                    • 1,390 Posts
                    Glad it worked out wink