{# 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) %} {% for element in collection if not root %}
  • {% if element.parent %}{% endif %} {{ element.name }} {{ element.description }} edit {% if true %}true{% endif %}
    {% if element.children|length %} {{ _self.navigate_child(element.children, admin, false) }} {% endif %}
  • {% endfor %} {% endmacro %} {% block tab_menu %} {% include 'SonataAdminBundle:CRUD:list_tab_menu.html.twig' with { 'mode': 'tree', 'action': action, 'admin': admin, } only %} {% endblock %} {% block list_table %}

    {{ 'element.tree_site_label'|trans({}, admin.translationdomain) }}

    {{ tree.navigate_child(collection, admin, true) }}
    {% endblock %}