{# This file is part of the Sonata package. (c) Thomas Rabaix For the full copyright and license information, please view the LICENSE file that was distributed with this source code. #} {# This template is not used at all, it is just a template that you can use to create your own custom tree view. #} {% extends 'SonataAdminBundle:CRUD:base_list.html.twig' %} {% import _self as tree %} {% macro navigate_child(collection, admin, root, depth) %} {% for element in collection %}
  • {% if element.parent or root %}{% endif %} {{ element.name }} {{ element.description }} {#edit #} {% if element.enabled %} {{ admin.trans('active', {}, admin.translationDomain) }}{% endif %} {% if not element.enabled %} {{ admin.trans('disabled', {}, admin.translationDomain) }}{% endif %}
    {% if element.children|length %} {{ _self.navigate_child(element.children, admin, false, depth + 1) }} {% endif %}
  • {% endfor %} {% endmacro %} {% block tab_menu %} {% include 'SonataClassificationBundle:CategoryAdmin:list_tab_menu.html.twig' with { 'mode': 'tree', 'action': action, 'admin': admin, } only %} {% endblock %} {% block list_table %}

    {{ admin.trans('tree_catalog_title', {}, admin.translationdomain) }} {% if not app.request.get('hide_context') %}
    {% endif %}

    {{ tree.navigate_child([main_category], admin, true, 0) }}
    {% endblock %}