Skip to content

Instantly share code, notes, and snippets.

@aronbudinszky
Last active April 10, 2016 22:13
Show Gist options
  • Save aronbudinszky/10691917 to your computer and use it in GitHub Desktop.
Save aronbudinszky/10691917 to your computer and use it in GitHub Desktop.
This is a demo of using recursive template inclusion in Outlast Framework to display nested categories.
<h1>Categories</h1>
{% block catlist %}
<ul>
{% foreach categories as cat %}
<li>
<a href="{{baseurl}}categories/{{cat.friendlyurl}}">{{cat.name}}</a>
{% if cat.data.subcategories.total > 0 %}
{% with categories=cat.data.subcategories %}
{% insert 'categories.html' 'catlist' %}
{% endwith %}
{% endif %}
</li>
{% endforeach %}
</ul>
{% endblock catlist %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment