We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10989
    • 29 Posts
    Hi, I’m having a problem with DropMenu, just wondering if it’s a known issue. For now, all I want to do is create a menu with a surrounding div with a specified id. The div is created when I use &topdiv=`true`, my problem is giving this div an id. The first sample in the snippet code says to use &menuName, but there is no mention of this variable elsewhere in the code. Later on in the snippet code it says to use &phName. http://modxcms.com/snippet-dropmenu.html also says to use &phName, but in the example says to use &menuName. I’ve tried using &menuName, then &phName, then both at the same time, but to no avail. All I get is a div tag with no id.

    I believe the problem lies in this part of the code:

    1.			// determine if it's a top category or not
    2.			$toplevel = !$inside;
    
    3.			// build the output
    4.			$topdivcls = (!empty($topdivClass)) ? ' class="'.$topdivClass.'"' : '';
    5.			$topdivblk = ($topdiv) ? "<div$topdivcls>" : '';
    6.			$topnavcls = (!empty($topnavClass)) ? ' class="'.$topnavClass.'"' : '';
    7.			$subdivcls = (!empty($subdivClass)) ? ' class="'.$subdivClass.'"' : '';
    8.			$subdivblk = ($subdiv) ? "<div$subdivcls>$ie" : '';
    9.			$subnavcls = (!empty($subnavClass)) ? ' class="'.$subnavClass.'"' : '';
    10.			$output = ($toplevel) ? "$topdivblk<ul$topnavcls>$ie" : "$ie$subdivblk<ul$subnavcls>$ie";
    


    In line 10, it checks to see if this is this is the beginning of the menu. If it is, it outputs the contents of $topdivblk, followed by the the beginning of the unordered list. $topdivblk is defined on line 5 as being the opening of a div tag, followed by the contents of $topdivcls. $topdivcls is defined in line 4 as being either the specified class for the top div, or empty. There’s no mention of an id for the div anywhere there. There’s no mention of phName anywhere in the code, apart from the declaration bit at the top of the snippet, and down the bottom where it says "$modx->setPlaceholder...".

    Is my understanding correct, or am I missing something?

    Thanks in advance smiley
      • 7923
      • 4,213 Posts
      correct, use wayfinder to do it..


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 10989
        • 29 Posts
        Thanks. I found out about Wayfinder soon after I posted that. If DropMenu is buggy and has been replaced by Wayfinder, why is DropMenu still included in the ModX download?
          • 25663 MODX Staff
          • 12,272 Posts
          The current MODx download was released a while ago, with the only update being a security fix from a few weeks ago. The next 0.9.5 release does not include DropMenu.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me