Reputation: 989
I am using version 3 of easyadmin. I need to add a button to the left of the user menu, because it is the main action of my system and I want it to be available in any view.
I think I should override the "header_custom_menu" block in layout template, but to be honest I don't know exactly how to do it.
On other occasions, it has created in "templates/bundles/EasyAdminBundle" some templates to override the original ones, such as index.html.twig, new.html.twig, etc.
But in this case I only have to override a block inside the layout.html.twig.
Try creating a layout.html.twig file with the following code, which obviously didn't work, because it goes into an infinite loop:
{% extends '@EasyAdmin/layout.html.twig' %}
{% block header_custom_menu %}
<button>my button</button>
{{ parent() }}
{% endblock header_custom_menu %}
Upvotes: 1
Views: 144