I have this loop in DotLiquid:
{% for page in Page -%}
{{ page.Title }}
<ul>
{% for subpage in page.Pages -%}
<li>{{ subpage.Title }}</li>
<!-- subpage.Pages has more pages and so on... -->
{% endfor -%}
</ul>
{% endfor -%}
Every subpage
object has a Pages
property with other subpages in a list (like the first Page
object.
How to I write a recursive iteration over these subpages to create the complete tree?