We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8461
    • 205 Posts
    Would someone be kind enough to have a quick look at this code. I am using the dropmenu snippet and the hereclass. However the here class was leaving a space after the end of the previous li item so I attempted to remove some white space to fix it but now I have no here class applied. (I have the remove lines option for IE set as this is a vertical list already)

    if ($itm && !$selfAsLink && ($child['id'] == $modx->documentIdentifier)) {
    					$output .= " <li class= \" $hereClass ". ($numChildren == 0 ? ' last' : '')."\">$itm</li>$ie";


    Many thanks
    • Hi edge,

      The only difference between your line and the standard line in Dropmenu is the spaces you have around the $hereclass, this is the standard line:

      $output .= "    <li class=\"$hereClass". ($numChildren == 0 ? ' last' : '')."\">$itm</li>$ie";


      Regards, Garry
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
      • Strip all the whitespace out. It can cause problems in IE and will not be around in the next version.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 8461
          • 205 Posts
          Thanks garryn and Ryan

          The mistake I made was to change the hereclass to an active link in my snippet at the same time as removing the white space. After removing white space my LI here class was no longer being applied so I had assumed it must have been when I removed the white space when in fact it was making the current page link the active link that created the problem.

          Basically you cannot use class="here" and also have the current link as active at the same time as I see it

          • that is correct; I use a hacked version that allows it to be both because I often use it for fancy styling.
              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