{# 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 %} {% if child.children %}
  • {% if child.url %}{% endif %} {{ child.name }} {% if child.url %}{% endif %} {% if child.description %}{# show info button if description available #} {% endif %}
  • {% 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 #} {% endif %}
  • {% endif %} {% endfor %}