{# # Single Category Tree Node (recursive) # # Renders one category as a list-group-item-action link with optional # collapsible nested list for children. Included recursively. # # Expected context: # node - Category node from wc_bootstrap_get_category_tree() # level - Current nesting depth (1-3) # # @package WcBootstrap # @since 0.1.7 #} {% set has_children = node.children is not empty %} {% set is_open = node.is_active or node.is_ancestor %}
{{ node.name }} ({{ node.count }}) {% if has_children %} {% endif %}
{% if has_children %}
{% for child in node.children %} {% include 'global/category-tree-node.html.twig' with { node: child, level: level + 1 } only %} {% endfor %}
{% endif %}