Hello,
I try to configure Dropmenu and I would like a specific class for subfolder who have chidren like this:
<ul>
<li>fruit
<ul>
<li class="daddy">apples</a>
<ul>
<li>green</li>
<li>red</li>
</ul>
</li>
<li>banana
</li>
</li>
<li>vegetable</li>
<ul>
How can I do that? I didn’t find any response in the documentation of dropmenu
Thanks
-
MODX Staff
- 12,272 Posts
You would have to change the code to add a class based on the document having (active) children. If you file a feature request in teh bug tracker this is something we can look at adding for the future.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
MODX Staff
- 12,272 Posts
What’s the purpose of the extra "parent" class, btw? There may be a way to style it without having to add an extra class.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
☆ A M B ☆
- 24,524 Posts
I did something similar here
http://www.alandaniel.co.uk/49.html, and I hacked the DropMenu snippet to give me the html identifiers that I needed.
Line 277 to give each top <li> (when using empty folders) an individual class so I could style each one differently (you can skip the .$categoryNumer if you don’t want individual styling):
$class .= ($class ? ' ' : '').$categoryClass.$categoryNumber;
And I get this HTML as a result:
<ul class="topnav">
<li class="category1">Under Construction
<ul>
<li><a href="51.html" title="">Project on 1st street</a></li>
<li><a href="52.html" title="">Mell street project</a></li>
<li><a href="53.html" title="">31-36 Dane street</a></li>
<li class="last"><a href="54.html" title="">Selmar department store</a></li>
</ul>
</li>
<li class="category2">Commercial
<ul>
<li><a href="56.html" title="">Project 1</a></li>
<li><a href="57.html" title="">Project 2</a></li>
<li><a href="58.html" title="">Project 3</a></li>
<li class="last"><a href="59.html" title="">Project 4</a></li>
</ul>
</li>
</ul>