This should be a basic Wayfinder question but I'm having problems structuring my Wayfinder chunks to make it happen.
I'm trying to add an accordion menu using Wayfinder. I'm utilizing the one offered by Dynamic Drive called "Bullet list accordion menu" on this page:
http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu.htm
The hard-coded version of this system calls for a CSS class to be added to the top level menu's li. Structured something like this:
<ul>
<li class="menuheader expandable"><a href="#">Menu One</a>
<ul class="categoryitems">
<li><a href="#">Menu One Submenu One</a></li>
<li><a href="#">Menu One Submenu Two</a></li>
<li><a href="#">Menu One Submenu Three</a></li>
<li><a href="#">Menu One Submenu Four</a></li>
<li><a href="#">Menu One Submenu Five</a></li>
<li><a href="#">Menu One Submenu Six</a></li>
</ul>
</li>
<li class="menuheader expandable"><a href="#">Menu Two</a>
<ul class="categoryitems">
<li><a href="#">Menu Two Submenu One</a></li>
<li><a href="#">Menu Two Submenu Two</a></li>
<li><a href="#">Menu Two Submenu Three</a></li>
<li><a href="#">Menu Two Submenu Four</a></li>
<li><a href="#">Menu Two Submenu Five</a></li>
<li><a href="#">Menu Two Submenu Six</a></li>
</ul>
</li>
<li class="menuheader expandable"><a href="#">Menu Three</a>
<ul class="categoryitems">
<li><a href="#">Menu Three Submenu One</a></li>
<li><a href="#">Menu Three Submenu Two</a></li>
<li><a href="#">Menu Three Submenu Three</a></li>
<li><a href="#">Menu Three Submenu Four</a></li>
<li><a href="#">Menu Three Submenu Five</a></li>
<li><a href="#">Menu Three Submenu Six</a></li>
</ul>
</li>
</ul>
Notice the first level of li has this:
<li class="menuheader expandable">
Now, I can understand that if that class existed within the top level ul, I would just create something like this within the outerTpl chunk:
<ul class="className">[[+wf.wrapper]]</ul>
...but we're talking about the first level li instead. Where and how do I code those class names in?
Also, when I look at the resulting source code of the page, I get a pesky
and
...on the first and last first level li items.
How do I add class names to the first level li items? How do I handle the "first" and "last" class names that Wayfinder takes upon itself to add for me?
Note: I had found a tutorial utilizing a Dynamic Drive accordion menu on this page:
http://wiki.modxcms.com/index.php/Accordion_menu_with_Wayfinder_using_JQuery
but their structuring appears different than what I'm experiencing on mine. Not sure if the Dynamic Drive coding changed since this tutorial was written since this tutorial doesn't seem to need to deal with a first level li class.
FWIW: my...
innerTPL chunk contains this:
<ul class="categoryitems">
[[+wf.wrapper]]
</ul>
rowTpl chunk contains this:
<li [[+wf.id]][[+wf.classes]]> <a href="[[+wf.link]]" title="[[+wf.title}]" [[+wf.attributes}]>[[+wf.linktext]]</a> [[+wf.wrapper]]</li>
outerTpl chunk contains this:
Wayfinder call contains this:
[[!Wayfinder?
&startId=`0`
&rowTpl=`menuRowsChunkName`
&outerTpl=`outerTplChunkName`
&innerTpl=`innerTplChunkName`
&levelLimit=`3`
&firstClass=``
&lastClass=``
]]
Thank you in advance.
MODx Revo 2.2.2
Wayfinder 2.3.3
[ed. note: waizen last edited this post 13 years, 11 months ago.]