We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23571
    • 223 Posts
    I have a menu that is:

    • Link 1
    • link 2[list]
      [li]Sublink 1
    • Sublink 2
    [/li]
    [/list]

    Now, Wayfinder applies the class of "last" to Sublink 2 and I can get the same result with &lastClass. How do I also add a "last" class (or any class) to Link 2 (or to the last list item in the root)?
      • 26016
      • 561 Posts
      I’m just looking at my fairly stock Wayfinder call, and what you’re describing is exactly what it’s doing. In fact, &lastClass is generally only needed to change the name of the "last class". I would suggest just doing a plain Wayfinder call, startId=`0` and nothing else, and start clicking on the menu, you’ll get insight into how it behaves.

      Cheers, Dave
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 36926
        • 701 Posts
        Quote from: pleth at Aug 18, 2010, 05:08 PM

        I have a menu that is:

        • Link 1
        • link 2[list]
          [li]Sublink 1
        • Sublink 2
        [/li]
        [/list]

        Now, Wayfinder applies the class of "last" to Sublink 2 and I can get the same result with &lastClass. How do I also add a "last" class (or any class) to Link 2 (or to the last list item in the root)?

        If you are using a custom row tpl, make sure you include the following in the li
        [+wf.classes+]
          • 23571
          • 223 Posts
          That’s what I am having trouble with. WF only adds "last" to the last li, not to the last li in the root list.

            • 36926
            • 701 Posts
            Quote from: pleth at Aug 18, 2010, 05:35 PM

            That’s what I am having trouble with. WF only adds "last" to the last li, not to the last li in the root list.



            It shouldn’t do, whats your wayfinder call and row templates if any?
              • 23571
              • 223 Posts
              This is my Wayfinder call:
              [[Wayfinder? &startId=`[[UltimateParent? &topLevel=`0`]]` &level=`2` &outerClass=`subnavigation` &displayStart=`1` &startItemTpl=`WFStartitemTPL`]]

              I think it is how to approach the row template that I am needing assistance with.
                • 36926
                • 701 Posts
                Quote from: pleth at Aug 19, 2010, 05:52 AM

                This is my Wayfinder call:
                [[Wayfinder? &startId=`[[UltimateParent? &topLevel=`0`]]` &level=`2` &outerClass=`subnavigation` &displayStart=`1` &startItemTpl=`WFStartitemTPL`]]

                I think it is how to approach the row template that I am needing assistance with.

                What happens if you just do a basic WF call, for example:
                [[Wayfinder? &startId=`0`]]
                


                Does it render the last class now?
                  • 23571
                  • 223 Posts
                  Same result, Wayfinder places the "last" class in the absolute last list item generated by the call rather than the last root list item. If the generated list ends with a root document with no parent it is not an issue, but if the last root document has children then the "last" class is applied to the last child rather than the last root document. This may be appropriate in some instances, just not in the design I am working with.

                  I was able to find a CSS workaround for this this morning BTW. I am not trying to kill the discussion, just any urgency on my end has been resolved in the short term.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    I can’t reproduce this; no matter how many levels, I get the last classname on every last li item in each level,whether or not the last item has any children.
                      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
                      • 23571
                      • 223 Posts
                      Hmm, okay. Maybe it is something on my end.