diff --git a/docs/reference/action_list.rst b/docs/reference/action_list.rst
index 1623b87518a..67f54881d4d 100644
--- a/docs/reference/action_list.rst
+++ b/docs/reference/action_list.rst
@@ -698,6 +698,20 @@ You need to add option ``show_mosaic_button`` in your admin services:
tags:
- { name: sonata.admin, manager_type: orm, group: admin, label: News, show_mosaic_button: false }
+Show Icons on Action Buttons
+----------------------------
+
+You can choose if the action buttons on the list-page show an icon, text or both.
+
+.. code-block:: yaml
+
+ # config/packages/sonata_admin.yaml
+
+ sonata_admin:
+ options:
+ # Choices are: text, icon or all (default)
+ list_action_button_content: icon
+
Checkbox range selection
------------------------
diff --git a/docs/reference/configuration.rst b/docs/reference/configuration.rst
index 2c058059e6c..c7c975be448 100644
--- a/docs/reference/configuration.rst
+++ b/docs/reference/configuration.rst
@@ -89,7 +89,8 @@ Full Configuration Options
default_label_catalogue: SonataAdminBundle
default_icon: 'fa fa-folder'
dropdown_number_groups_per_colums: 2
- title_mode: ~ # One of "single_text"; "single_image"; "both"
+ logo_content: 'all' # One of "text"; "icon"; "all"
+ list_action_button_content: 'all' # One of "text"; "icon"; "all"
# Enable locking when editing an object, if the corresponding object manager supports it.
lock_protection: false
diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php
index d164c7f6554..757dd2e89bd 100644
--- a/src/DependencyInjection/Configuration.php
+++ b/src/DependencyInjection/Configuration.php
@@ -180,10 +180,21 @@ public function getConfigTreeBuilder()
->end()
->integerNode('dropdown_number_groups_per_colums')->defaultValue(2)->end()
->enumNode('title_mode')
+ ->setDeprecated('The "%node%" option is deprecated since sonata-project/admin-bundle 3.x. Use "logo_content" instead.')
->values(['single_text', 'single_image', 'both'])
->defaultValue('both')
->cannotBeEmpty()
->end()
+ ->enumNode('logo_content')
+ ->values(['text', 'icon', 'all'])
+ ->defaultValue('all')
+ ->cannotBeEmpty()
+ ->end()
+ ->enumNode('list_action_button_content')
+ ->values(['text', 'icon', 'all'])
+ ->defaultValue('all')
+ ->cannotBeEmpty()
+ ->end()
->booleanNode('lock_protection')
->defaultFalse()
->info('Enable locking when editing an object, if the corresponding object manager supports it.')
diff --git a/src/Resources/views/CRUD/list__action_delete.html.twig b/src/Resources/views/CRUD/list__action_delete.html.twig
index 1439dd072e7..cde7ad1242a 100644
--- a/src/Resources/views/CRUD/list__action_delete.html.twig
+++ b/src/Resources/views/CRUD/list__action_delete.html.twig
@@ -10,12 +10,21 @@ file that was distributed with this source code.
#}
{% if admin.hasAccess('delete', object) and admin.hasRoute('delete') %}
+ {% set button_content = sonata_config.getOption('list_action_button_content') %}
-
+ {% if button_content == 'icon' or button_content == 'all' %}
+
+ {% endif %}
+ {% if button_content != 'text' and button_content != 'all' %}
+
+ {% endif %}
{{ 'action_delete'|trans({}, 'SonataAdminBundle') }}
+ {% if button_content != 'text' and button_content != 'all' %}
+
+ {% endif %}
{% endif %}
diff --git a/src/Resources/views/CRUD/list__action_edit.html.twig b/src/Resources/views/CRUD/list__action_edit.html.twig
index d130c9e576a..147382884b5 100644
--- a/src/Resources/views/CRUD/list__action_edit.html.twig
+++ b/src/Resources/views/CRUD/list__action_edit.html.twig
@@ -10,12 +10,21 @@ file that was distributed with this source code.
#}
{% if admin.hasAccess('edit', object) and admin.hasRoute('edit') %}
+ {% set button_content = sonata_config.getOption('list_action_button_content') %}
-
+ {% if button_content == 'icon' or button_content == 'all' %}
+
+ {% endif %}
+ {% if button_content != 'text' and button_content != 'all' %}
+
+ {% endif %}
{{ 'action_edit'|trans({}, 'SonataAdminBundle') }}
+ {% if button_content != 'text' and button_content != 'all' %}
+
+ {% endif %}
{% endif %}
diff --git a/src/Resources/views/CRUD/list__action_history.html.twig b/src/Resources/views/CRUD/list__action_history.html.twig
index f4a2619ea10..161bdef9c97 100644
--- a/src/Resources/views/CRUD/list__action_history.html.twig
+++ b/src/Resources/views/CRUD/list__action_history.html.twig
@@ -10,12 +10,21 @@ file that was distributed with this source code.
#}
{% if admin.hasAccess('history', object) and admin.hasRoute('history') %}
+ {% set button_content = sonata_config.getOption('list_action_button_content') %}
-
- {{ 'link_action_history'|trans({}, 'SonataAdminBundle') }}
+ {% if button_content == 'icon' or button_content == 'all' %}
+
+ {% endif %}
+ {% if button_content != 'text' and button_content != 'all' %}
+
+ {% endif %}
+ {{ 'link_action_history'|trans({}, 'SonataAdminBundle') }}
+ {% if button_content != 'text' and button_content != 'all' %}
+
+ {% endif %}
{% endif %}
diff --git a/src/Resources/views/CRUD/list__action_show.html.twig b/src/Resources/views/CRUD/list__action_show.html.twig
index 8d407d50ba1..d091c85e6cb 100644
--- a/src/Resources/views/CRUD/list__action_show.html.twig
+++ b/src/Resources/views/CRUD/list__action_show.html.twig
@@ -10,12 +10,21 @@ file that was distributed with this source code.
#}
{% if admin.hasAccess('show', object) and admin.hasRoute('show') %}
+ {% set button_content = sonata_config.getOption('list_action_button_content') %}
-
+ {% if button_content == 'icon' or button_content == 'all' %}
+
+ {% endif %}
+ {% if button_content != 'text' and button_content != 'all' %}
+
+ {% endif %}
{{ 'action_show'|trans({}, 'SonataAdminBundle') }}
+ {% if button_content != 'text' and button_content != 'all' %}
+
+ {% endif %}
{% endif %}
diff --git a/src/Resources/views/standard_layout.html.twig b/src/Resources/views/standard_layout.html.twig
index 4c915adfbfd..a65e5b90879 100644
--- a/src/Resources/views/standard_layout.html.twig
+++ b/src/Resources/views/standard_layout.html.twig
@@ -125,10 +125,18 @@ file that was distributed with this source code.
{% block logo %}
{% apply spaceless %}
- {% if 'single_image' == sonata_config.getOption('title_mode') or 'both' == sonata_config.getOption('title_mode') %}
+ {# NEXT_MAJOR: Remove the title_mode check #}
+ {% if 'icon' == sonata_config.getOption('logo_content')
+ or 'all' == sonata_config.getOption('logo_content')
+ and ('single_image' == sonata_config.getOption('title_mode') or 'both' == sonata_config.getOption('title_mode'))
+ %}
{% endif %}
- {% if 'single_text' == sonata_config.getOption('title_mode') or 'both' == sonata_config.getOption('title_mode') %}
+ {# NEXT_MAJOR: Remove the title_mode check #}
+ {% if 'text' == sonata_config.getOption('logo_content')
+ or 'all' == sonata_config.getOption('logo_content')
+ and ('single_text' == sonata_config.getOption('title_mode') or 'both' == sonata_config.getOption('title_mode'))
+ %}
{{ sonata_config.title }}
{% endif %}
diff --git a/src/SonataConfiguration.php b/src/SonataConfiguration.php
index c750e15d906..eefe3102b8b 100644
--- a/src/SonataConfiguration.php
+++ b/src/SonataConfiguration.php
@@ -25,7 +25,9 @@
* javascripts: list,
* js_debug: bool,
* legacy_twig_text_extension: bool,
+ * list_action_button_content: 'text'|'icon'|'all',
* lock_protection: bool,
+ * logo_content: 'text'|'icon'|'all',
* mosaic_background: string,
* pager_links: ?int,
* role_admin: string,
@@ -34,7 +36,6 @@
* skin: string,
* sort_admins: bool,
* stylesheets: list,
- * title_mode: 'single_text'|'single_image'|'both',
* use_bootlint: bool,
* use_icheck: bool,
* use_select2: bool,