{# the variables tree_template and tree_items must be defined before entering #}
{# tree_items is a list of dicts with properties name, url, children #}
{% for child in tree_items %}
{% with child.children as tree_items %}
{% include tree_template %}
{% endwith %}
{% else %}
{# No children: it's a leaf. #}
{% if child.url %}
{{ child.name }}
{% else %}
{{ child.name }}
{% endif %}
{% if child.description %}{# show info button if description available #}
{% autoescape off %}{{ child.description }}{% endautoescape %}