We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13986
    • 90 Posts
    I’m using wayfinder on a website that has a dropdown menu system, using Superfish+jquery. The problem occurs when the navigation menu only has 1 dropdown item. Wayfinder does not give the sub li a class of "last", I assume because it is also the first li.

    This means that my li.last is not being applied to that li. in this case the bottom border is missing (plus also the rounded corners in modern browsers).

    here’s the site: http://www.smartcomfortadvisors.com/modx/
    example compare the bottom of the drop menu item under "Who we are" to the last menu item under "What we do".

    Any thoughts on how to fix this issue?

    Thanks.
      Jeremy Foster
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The culprit is on line 93 of wayfinder.inc.php:
      if ($counter == ($numSubItems) && $numSubItems > 1) {
          $docInfo['last'] = 1;
      } else {
          $docInfo['last'] = 0;
      }
      

      The $numSubItems > 1 is what keeps it from applying the "last" classname if there’s only 1 item.
        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
        • 13986
        • 90 Posts
        Thanks.
        I changed the code to solve my problem.

        if ($counter == ($numSubItems) && $numSubItems >= 1) {
            $docInfo['last'] = 1;
        } else {
            $docInfo['last'] = 0;
        }
          Jeremy Foster