Quote from: joyobject at Dec 23, 2013, 04:08 AMI have made the menu using css to show and hide submenu. The html structure is pretty much the same as the wayfinder default. So I there is no need to use tpl. However I would like to show submenu on one or two parent menus.
My original thought is to assign specific class to the parent menu so that I can control show and hide in css.
Any suggestion?
Thank you
So you just want to create a way to show hide submenus?
Let´s say you have an output like this:
<ul>
<li class="item-with-childs"><span class="toggle-btn">Toggle</span> Item 1
<ul class="sub-items">
<li>Sub Item 1</li>
<li>Sub Item 2</li>
<li>Sub Item 3</li>
</ul>
</li>
<li class="item-with-childs"><span class="toggle-btn">Toggle</span> Item 2
<ul class="sub-items">
<li>Sub Item 1</li>
<li>Sub Item 2</li>
<li>Sub Item 3</li>
</ul>
</li>
</ul>
Then with some little jQuery function you´ll do the magic:
$(function(){
// I recommend hide the menus with CSS
$(".sub-items").hide();
$(".toggle-btn").on("click", function(){
$(this).next(".sub-items").slideToggle();
});
});
Of course you then you have to access the wayfinder templates to add the classes to have a menu like this one working!!!

If in your folder menu you don´t need to link to anywhere, just put the class toggle-btn on it, remove of course the span... and in your wayfinder template (corresponding to this item, remove the link attribute... use wayfinder just to output the name of your folder item.
I hope i could help you!!!