We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22815
    • 1,097 Posts
    I meant "what happens if you try this inelegant solution".

    It is not a slang word, if anything it is jargon. I note from Wikipedia’s kludge entry (which can of course be found within seconds) that it is specifically recognised within computer terminology.

    Quote from: simonok at Aug 01, 2006, 03:08 PM

    Nope it generates
    div class="simon" i">
    This rather suggests that there’s an upper character limit on the class name. Ah well.

    Quote from: simonok at Aug 01, 2006, 02:58 PM

    Do you know how I can add the id to the php code?
    1) Look for a class= near to topdivClass
    2) Compare with the id= near to menuName
    3) Use basic programming and HTML skills to add the ID.


      No, I don't know what OpenGeek's saying half the time either.
      MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
      Forum: Where to post threads about add-ons | Forum Rules
      Like MODx? donate (and/or share your resources)
      Like me? See my Amazon wishlist
      MODx "Most Promising CMS" - so appropriate!
    • Quote from: PaulGregory at Aug 01, 2006, 02:58 PM

      Does the kludge
      &topdivClass=`simon" id="mymenu`
      work?
      EDIT: In case it’s not obvious, the idea here is to trick DropMenu. DropMenu will start that string off with class=" and end with another ", but inside you’re ending the class early and starting the ID. DropMenu’s " to end the class ends up ending the ID.

      Can’t have = in an argument.

      In line 130, add:
      // $topdivID [string]
      // css id for DIV wrapping top level UL
      $topdivID = (!isset($topdivID)) ? 'topdiv' : "$topdivID";
      


      This allows you to add the &topdivID=`whatever` argument to the DropMenu call. It can be the same as the class name.

      In lines 195, 257, 325 and 329, the calls to the MakeMap function, add $topdivID to the argument list somewhere.

      Line 211, after the line that assigns the $topdivcls value, add (watch out for the space before id=):
      			$topdivname = (!empty($topdivId)) ? ' id="'.$topdivID.'"' : '',

      The follwing line, addd the $topdivnam to the output:
      			$topdivblk = ($topdiv) ? "<div$topdivcls$topdivname>" : '';


      that should do the trick; it may have a typo or something, I haven’t actually tested it. But it will be nicer than actually hardcoding an Id into the snippet; if you want to you can do that in the last line of code above, in the $topdivblk = line, instead of adding $topdivname just add id="whatever".





        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
        • 27305
        • 173 Posts
        Do you have the full snippet with the hacks, I just tried what you said and it broke.

        I do appreciate you help
          I made my first site with modx
          ------------------------
          Shopping blog
          Sky+ HD
        • Ok, I’ll pay attention and test it.
            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
          • Ugh. Two typos in one line!
            			$topdivname = (!empty($topdivId)) ? ' id="'.$topdivID.'"' : '',
            should have been
            			$topdivname = (!empty($topdivID)) ? ' id="'.$topdivID.'"' : '';

              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
              • 27305
              • 173 Posts
              That worked a treat you are a star!

              I`m gettin there.

              Kick on

              ss
                I made my first site with modx
                ------------------------
                Shopping blog
                Sky+ HD
                • 34017
                • 898 Posts
                Now that’s service!
                  Chuck the Trukk
                  ProWebscape.com :: Nashville-WebDesign.com
                  - - - - - - - -
                  What are TV's? Here's some info below.
                  http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                  http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
                  • 27305
                  • 173 Posts
                  susan rocks!
                    I made my first site with modx
                    ------------------------
                    Shopping blog
                    Sky+ HD