# V2_Category_Tree

    {% set categoryTree = module('V2_Category_Tree', null, {
      bid: null,
      cid: null,
      keyword: null,
      field: null,
      order: null,
      start: '1000-01-01 00:00:00',
      end: '9999-12-31 23:59:59'
    }) %}

    {% if categoryTree.items is not empty %}
      {% macro renderCategories(categories) %}
        <ul class="acms-list-group">
          {% for category in categories %}
            <li class="acms-list-group-item">
              <a href="{{ category.url }}">
                {{ category.name }}
                {% if category.amount is not empty %}
                  <span class="acms-badge acms-float-right">{{ category.amount }}</span>
                {% endif %}
              </a>
              {% if category.children is defined %}
                {{ _self.renderCategories(category.children) }}
              {% endif %}
            </li>
          {% endfor %}
        </ul>
      {% endmacro %}

      <div class="acms-margin-bottom-medium">
        {{ include('/admin/module/setting.twig', { moduleInfo: categoryTree.moduleInfo }) }}
        {{ _self.renderCategories(categoryTree.items) }}
      </div>
    {% endif %}