Open phso opened 4 years ago
Same here, I solved extending tree.html.twig template from this bundle and adding these blocks from base_list.html.twig layout from sonata admin:
{%- block tab_menu -%}
{{ knp_menu_render(admin.sidemenu(action), {
'currentClass': 'active',
'template': get_global_template('tab_menu_template')
}, 'twig') }}
{%- endblock -%}
{% block title %}
{{ admin.isChild and admin.parent.subject ? 'title_edit'|trans({'%name%': admin.parent.toString(admin.parent.subject)|truncate(15) }, 'SonataAdminBundle') : '' }}
{% endblock %}
{% block navbar_title %}
{{ admin.isChild and admin.parent.subject ? 'title_edit'|trans({'%name%': admin.parent.toString(admin.parent.subject)|truncate(100) }, 'SonataAdminBundle') : '' }}
{% endblock %}
we work on a projekt with symfony 4 and sonata. we are using the SonataAdminTreeBundle to manage our Categories.
symfony packages:
sonata packages:
basically everything works fine - but the menu from sonata were the datagrid filters are located (aka navbar) is not showing up. in that menu you can usually switch the view modes (grid, list, tree) and set up some filters. it worked at the start but once i tried the tree view for the first time, everything was gone and did not show up again.
so what we basically do is: src/Admin/CategoryAdmin: