Displaying multiple subcategories in Collection template

pixellabpixellab Member Posts: 1

Hello,

I am trying to display all categories from multiple levels (3 levels total), but for some reason I can only get 2 levels of categories to display.

I have a hierarchy that is in the form: Parent>Child>Grandchild

In my `collection.rain` file, the Parent and Child categories display correctly, but I am unable to get the grandchild to show.


Can someone please help me with the code? What I have is the following:

<ul>
{% for category in shop.categories %}
    <li>{{ category.title }}
    {% if category is active and category.subs %}
        <ul>
        {% for subcategory in category.subs %}
            <li>{{ subcategory.title }}</li>
            {# WHAT DO I PUT HERE TO SHOW THE 3rd CATEGORY? #}
        {% endfor %}
	</ul>
    {% endif %}
    </li>
{% endfor %}
</ul>

1 comment

Sign In or Register to comment.