We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20079
    • 49 Posts
    I need my DropMenu to generate

    <ul id="topmenu">
    <li>linko1</li>
    <li>link02</li>
    </ul>


    ,but modX generates UL class="topmenu".

    How i can make it to define first UL by ID? ( becayse DOM uses .getElementById and there is no getElementByClass )

    seems like &phName [ string ] should do the job, but i cant manage it to work. Is there a solution?
    Thanks.
      • 263
      • 52 Posts
      This can be done quite easily by modifying the DropMenu snippet. Best to make a backup/duplicate first! Find this code: (line 212 maybe)
      $topnavcls = (!empty($topnavClass)) ? ' class="'.$topnavClass.'"' : '';
      and replace with:
      $topnavcls = (!empty($topnavClass)) ? ' id="'.$topnavClass.'"' : '';

      That’s the minimum needed to get the snippet to output what want; a proper job would also mean editing the all the code referring to this output - e.g. $topnavClass > $topnavID - a good opportunity to learn the inner workings of MODx!

      Cheers
        • 20079
        • 49 Posts
        thanks a lot.
        i will try and see how it works. =]