{# 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. #} {% extends 'SonataAdminBundle:CRUD:base_list.html.twig' %} {% import _self as tree %} {% macro navigate_child(collection, admin, root, current_category, depth) %} {% if root and collection|length == 0 %}

{{ admin.trans('warning_no_category', {}, admin.translationdomain) }}

{% endif %} {% for element in collection %}
  • {% if element.parent or root %}{% endif %} {{ element.name }}
    {% if element.children|length %} {{ _self.navigate_child(element.children, admin, false, current_category, depth + 1) }} {% endif %}
  • {% endfor %} {% endmacro %} {% block list_table %}
    {{ tree.navigate_child([root_category], admin, true, datagrid.values['category']['value'], 1) }}
    {{ parent() }}
    {% endblock %}