Closed turolopezsanabria closed 7 years ago
Hello I'm trying to hide all submenu items, and display them only if the parent is active. The problem is that the menu has only <li> for all levels. It would be great to have a structure like the one below, but I can't make it work:
<li>
<ul class="doc-nav"> <li><a class="link active" href="#">Title</a></li> <li> <ul class="doc-nav-sub-list"> <li>Section 1</li> <li>Section 2</li> <li>Section 3</li> <ul> <li>Section 3.1</li> <li>Section 3.2</li> <li>Section 3.3</li> </ul> <li>Section 4</li> </ul> </li> </ul>
Instead of what I get right now:
<ul class="doc-nav"> <li><a class="link active" href="#">Title</a></li> <li> <ul class="doc-nav-sub-list"> <li class="child">Section 1</li> <li class="child">Section 2</li> <li class="child">Section 3</li> <li class="grandchild">Section 3.1</li> <li class="grandchild">Section 3.2</li> <li class="grandchild">Section 3.3</li> <li class="child">Section 4</li> </ul> </li> </ul>
I've tried many things, including things like the one below, but it's not working Can you help?
{{#each menu}} {{#each children}} <li> {{header}} {{#if grandchildren}}<ul>{{#each grandchildren}}<li>{{header}}</li>{{#each}}{{/if}} </li> {{#each}} {{#each}}
Just in case anyone else is interested, I responded to @turolopezsanabria about this here also - hopefully it helps? https://github.com/kss-node/kss-node/issues/407
Thanks for your help @ajbrun
Hello I'm trying to hide all submenu items, and display them only if the parent is active. The problem is that the menu has only
<li>
for all levels. It would be great to have a structure like the one below, but I can't make it work:Instead of what I get right now:
I've tried many things, including things like the one below, but it's not working Can you help?