We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34077 ☆ A M B ☆
    • 64 Posts
    I’m trying to create a sub/side nav menu where it will include the parent container in the menu as well instead of just the container items. Here is the call I’m using:
    [!Wayfinder?&startId=`47`&level=1&rowTpl=`side.RowTpl`&lastRowTpl=`side.LastRowTpl!]

    I tried creating a web link two different ways thinking that would work but then the active styling/class assignment gets messed up. If I use a weblink for the container, it doesn’t stay active for other sub pages. If I use a weblink for a list item, it always shows active even when on other pages.

    I’m guessing this is something simple that I’m overlooking. Any recommendations/help would be very much appreciated.
      Jason Bird
      Twitter: @jasonabird @threeeyedbird
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      &displayStart
      Normally Wayfinder only lists the descendants of the document specified in &startId. But when you set this parameter to TRUE, and if &startId is set to a value other than zero, then Wayfinder will use the template specified in the parameter &startItemTpl to display information about the start document. This is particularly useful when using Wayfinder to generate a subsidiary menu whose header or title block needs to display information from the starting document.
        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
        • 34077 ☆ A M B ☆
        • 64 Posts
        Thanks for the feedback. That was sort of what I was trying to find. I still can’t seem to get it to work right though. Ideally, if the active class on subnav would work right would be best. It keeps the web link to the parent active even if not on the parent item. Maybe I’m trying to do something that is not possible with WayFinder as it sits today.
          Jason Bird
          Twitter: @jasonabird @threeeyedbird
          • 16183
          • 1,390 Posts
          Quote from: Bird at Jun 23, 2009, 04:27 PM

          Thanks for the feedback. That was sort of what I was trying to find. I still can’t seem to get it to work right though. Ideally, if the active class on subnav would work right would be best. It keeps the web link to the parent active even if not on the parent item. Maybe I’m trying to do something that is not possible with WayFinder as it sits today.

          You want post the chunks you are using and a link to the site if it is live? The more details the better with respect to resolving the issue.

          cheers/k
            • 34077 ☆ A M B ☆
            • 64 Posts
            It is still in early development:
            http://204.200.159.228/services.html

            You’ll see Hair is a link to the parent container where makeup is a separate page.

            Here are the calls and templates:
            Menu Call
            [!Wayfinder?&startId=`47`&level=1&rowTpl=`side.RowTpl`&lastRowTpl=`side.LastRowTpl!]

            Row Tpl
            <li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>
            <li class="sidenavbreak"></li>
            

            Last row tpl just takes out the bottom li.
              Jason Bird
              Twitter: @jasonabird @threeeyedbird
              • 16183
              • 1,390 Posts
              Quote from: Bird at Jun 23, 2009, 04:59 PM

              [!Wayfinder?&startId=`47`&level=1&rowTpl=`side.RowTpl`&lastRowTpl=`side.LastRowTpl!]


              Don’t know if it’s a typo, but you are missing a closing ` on side.LastRowTpl.

              I take it you are using Wayfinder 2.5 beta then?

              /k
                • 34077 ☆ A M B ☆
                • 64 Posts
                That was a typo but that part seemed to still work. I’m using 2.0.1 that someone posted on the forums that added the lastTpl function. Typo now fixed and active class issue still stands sad.
                  Jason Bird
                  Twitter: @jasonabird @threeeyedbird
                  • 16183
                  • 1,390 Posts
                  OK, so what was the problem again? Could you please explain using your menu items (Hair, Makeup, Nails, etc)?

                  Btw, that code Row Tpl code above with the extra li, i.e.

                  <li class="sidenavbreak"></li>
                  will most likely not validate

                  EDIT: You replied while I was typing but my question still stands...

                  FYI, the new Wayfinder 2.5 beta has lastRowTpl natively. Link to he hacked code? (am not a fun of hacking code, btw wink )

                  cheers/k
                    • 34077 ☆ A M B ☆
                    • 64 Posts
                    Hair is a weblink to the main nav services page/parent. Hair keeps the active class no matter what page from subnav is open. I want the weblink hair to only be active when on the services.html page. Does that make sense?

                    As for the extra li, that part is validating fine atm. Why would it not?

                    Might have to look into 2.5. Not sure exactly where I found the code as it was a few months ago. Here is the updated info from the snippet though:
                     Snippet name: Wayfinder
                     Short Desc: builds site navigation
                     Version: 2.0.1
                     Authors: 
                    	Kyle Jaebker (muddydogpaws.com)
                    	Ryan Thrash (vertexworks.com)
                     Date: February 27, 2006
                     06 January 2009 - Modified by [email protected] : added lastRowTpl and weblinks here patch.
                     15 July 2008 - Modified by [email protected] - added odd & even classes
                      Jason Bird
                      Twitter: @jasonabird @threeeyedbird
                      • 16183
                      • 1,390 Posts
                      Am I right to assume that "Makeup, Nails, Tanning.....etc...Spa Parties & Packages" are all child documents of services? If that is the case, then with the way you have the menu set up, Hair will always have the active class applied to it as long as its child docs are active. This is because, "active" is the default value of the &hereClass; This class is applied all the way up the tree to the current item and to each parent up the document tree.

                      /k