You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, when trying to display a recursive navigation structure in somewhat more complex HTML, you quickly reach the limits with the Antlers tags.
I particularly miss loop variables, such as those provided by Twig for example. Specifically, something like {{ iterator }}, {{ is_first }} and {{ is_last }} would be useful here.
In addition, custom antler variables in the magic variable {{ *recursive children* }} are not taken into account, i.e. a manual counter is also not possible recursively - could this possibly be a bug?
{{ counter = 0 }}
<ul>
{{ nav:my_handle }}
<li>{{ counter }}: <a href="{{ url }}">{{ title }}</a></li>
{{ if children }}
<!-- counter will not be incremted, if *recursive child* is called -->
{{ counter = counter + 1 }}
<ul>{{ *recursive children* }}</ul>
{{ /if }}
{{ /nav:my_handle }}
</div>
It would also be helpful if a {{ nav:collection:pages }} tag could also be assigned with an offset parameter so that, for example, only the subpages can be output recursively, or a page tree starting from any point (e.g. current page or parent page). The current examples in the documentation only shows snippets for one level, but not recursively.
Please let me know what you think.
Best regards, LA
The text was updated successfully, but these errors were encountered:
Unfortunately, when trying to display a recursive navigation structure in somewhat more complex HTML, you quickly reach the limits with the Antlers tags.
I particularly miss loop variables, such as those provided by Twig for example. Specifically, something like
{{ iterator }}
,{{ is_first }}
and{{ is_last }}
would be useful here.In addition, custom antler variables in the magic variable
{{ *recursive children* }}
are not taken into account, i.e. a manual counter is also not possible recursively - could this possibly be a bug?It would also be helpful if a
{{ nav:collection:pages }}
tag could also be assigned with an offset parameter so that, for example, only the subpages can be output recursively, or a page tree starting from any point (e.g. current page or parent page). The current examples in the documentation only shows snippets for one level, but not recursively.Please let me know what you think.
Best regards, LA
The text was updated successfully, but these errors were encountered: