{##
# Top categories tree
#}
<ul class="flyout-menu{% if not this.isSubtree() %} catalog-categories catalog-categories-tree{% else %} sublevel{% endif %}">
{% if not this.isSubtree() %}
{{ widget_list('topCategories.linksAbove') }}
{% endif %}
{% for idx, _category in this.getCategories(this.rootId) %}
<li {{ this.displayItemClass(idx, loop.length, _category)|raw }}>
{{ widget(template=this.getDir() ~ "parts/category.link.twig", _category=_category, isShowTriangle=this.isShowTriangle() and _category.hasSubcategories) }}
{% if _category.hasSubcategories and this.isAllowedDepthWithoutAjax(_category.depth) %}
{{ widget(template=this.getBody(), rootId=_category.id, is_subtree='1') }}
{% endif %}
</li>
{% endfor %}
{% for idx, w in this.getViewList('topCategories.children', {'rootId': this.getParam('rootId'), 'is_subtree': this.getParam('is_subtree')}) %}
<li {{ this.displayListItemClass(idx, loop.length, w)|raw }}>{{ w.display() }}</li>
{% endfor %}
{% if not this.isSubtree() %}
{{ widget_list('topCategories.linksUnder') }}
{% endif %}
</ul>