Easyadminbundle: Add custom action next to "new" action

Created on 22 Nov 2016  路  2Comments  路  Source: EasyCorp/EasyAdminBundle

Hello,

I want to know if it is possible to add a custom action next to "new" action in list page ?

Example:

image

Thank's

feature

Most helpful comment

@anthony-launay you can do that ... but this kind of "global actions" are not supported natively by the bundle.

The solution is to override the default list.html.twig (for the entire backend or just for an entity) and then define that new action in the global_actions Twig block. For example, to add this action just for the User entity, create this simple Twig template:

{# app/Resources/views/easy_admin/User/list.html.twig #}
{% extends '@EasyAdmin/default/list.html.twig' %}

{% block global_actions %}
  {{ parent() }}

  HERE you can add the button for your own action
{% endblock %}

You can also define the custom template in any other location, as explained in https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/book/3-list-search-show-configuration.md#advanced-design-configuration

The feature to add "global actions" has been added to the list of future features of this bundle so I'm closing this issue. Thanks!

All 2 comments

@anthony-launay you can do that ... but this kind of "global actions" are not supported natively by the bundle.

The solution is to override the default list.html.twig (for the entire backend or just for an entity) and then define that new action in the global_actions Twig block. For example, to add this action just for the User entity, create this simple Twig template:

{# app/Resources/views/easy_admin/User/list.html.twig #}
{% extends '@EasyAdmin/default/list.html.twig' %}

{% block global_actions %}
  {{ parent() }}

  HERE you can add the button for your own action
{% endblock %}

You can also define the custom template in any other location, as explained in https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/book/3-list-search-show-configuration.md#advanced-design-configuration

The feature to add "global actions" has been added to the list of future features of this bundle so I'm closing this issue. Thanks!

Thanks, I had thought of the solution to overwrite the template, however, I thought it was possible to do this in configuration.

Have a good day

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ealenn picture Ealenn  路  3Comments

cve picture cve  路  4Comments

Wait4Code picture Wait4Code  路  3Comments

ndench picture ndench  路  4Comments

ghost picture ghost  路  3Comments