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