Hi ,
I'm trying to achieve dynamic navigation , where in author can specify depth level and navigation automatically builds up to that depth level .I'm trying to achieve this use case using sightly .
I have achieved the dynamic navigation using data-sly-template and works fine , something like below ,
<nav class="Secondary-navigation" role = "navigation">
<ul data-sly-list.page="${topnav.rootPage.listChildren}" data-sly-unwrap>
<div data-sly-call="${descendants.nav @ page=page ,depth= [[[[]]]] }" data-sly-unwrap></div>
</ul>
</nav>
I have referrd tower of hanoii https://twitter.com/sightlyio/status/545586838342488064 to set a counter for depth .
Now instead of harcoding depth as empty iterables [[[[]]]] , i 'm trying to dynamically generate . I'm struggling to achieve it .
Using java class extended form wcmuse , i'm returning string as [[[[]]]] , but sightly doesn't seem to pick if I pass as strings . Do i need to pass any empty iterables ? Can any one throw any pointers for this ? Much appreciated .