Skip to content

Instantly share code, notes, and snippets.

@nanasess
Created July 22, 2015 01:11
Show Gist options
  • Save nanasess/92213029d36219f1ab3e to your computer and use it in GitHub Desktop.
Save nanasess/92213029d36219f1ab3e to your computer and use it in GitHub Desktop.
{% macro recursiveCategories(Category) %}
{% if Category.hasChildNodes() %}
<ul>
{% for child in Category.childNodes() %}
<li>{{ child.name }}</li>
{{ _self.recursiveCategories(child) }}
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
{% if Category.hasChildNodes() %}
<ul>
{% for ChildCategory in Category.childNodes() %}
<li>{{ ChildCategory.name }}</li>
{{ _self.recursiveCategories(ChildCategory) }}
{% endfor %}
</ul>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment