Skip to content
  • About
    • What is Symfony?
    • Community
    • News
    • Contributing
    • Support
  • Documentation
    • Symfony Docs
    • Symfony Book
    • Screencasts
    • Symfony Bundles
    • Symfony Cloud
    • Training
  • Services
    • Platform.sh for Symfony Best platform to deploy Symfony apps
    • SymfonyInsight Automatic quality checks for your apps
    • Symfony Certification Prove your knowledge and boost your career
    • SensioLabs Professional services to help you with Symfony
    • Blackfire Profile and monitor performance of your apps
  • Other
  • Blog
  • Download
sponsored by
  1. Home
  2. Documentation
  3. Bundles
  4. SonataAdminBundle
  5. Configuration

Configuration

Edit this page

Note

This page will be removed soon, as it's content is being improved and moved to other pages of the documentation. Please refer to each section's documentation for up-to-date information on SonataAdminBundle configuration options.

Configuration

Configuration options

1
2
3
4
5
6
7
8
9
10
# config/packages/sonata_admin.yaml

sonata_admin:
    security:

        # the default value
        handler: sonata.admin.security.handler.role

        # use this service if you want ACL
        handler: sonata.admin.security.handler.acl

Full Configuration Options

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Default configuration for extension with alias: "sonata_admin"
sonata_admin:
    security:
        handler: sonata.admin.security.handler.noop

        role_admin: ROLE_ADMIN
        role_super_admin: ROLE_SUPER_ADMIN

        information:

            # Prototype
            id: []
        admin_permissions:

            # Defaults:
            - CREATE
            - LIST
            - DELETE
            - UNDELETE
            - EXPORT
            - OPERATOR
            - MASTER
        object_permissions:

            # Defaults:
            - VIEW
            - EDIT
            - HISTORY
            - DELETE
            - UNDELETE
            - OPERATOR
            - MASTER
            - OWNER
        acl_user_manager: null
    title: 'Sonata Admin'
    title_logo: bundles/sonataadmin/images/logo_title.png
    search: true
    default_controller: 'sonata.admin.controller.crud'
    options:
        html5_validate: true

        # Auto order groups and admins by label or id
        sort_admins: false
        confirm_exit: true
        js_debug: false
        skin: 'skin-black'
        use_select2: true
        use_icheck: true
        use_bootlint: false
        use_stickyforms: true
        pager_links: null
        form_type: 'standard' # One of "standard"; "horizontal"
        default_admin_route: show
        default_group: default
        default_translation_domain: SonataAdminBundle
        default_icon: 'fas fa-folder'
        dropdown_number_groups_per_colums:  2
        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
    dashboard:
        groups:

            # Prototype
            id:
                label: ~
                translation_domain: ~
                icon: ~
                provider: ~
                items:
                    admin: ~
                    label: ~
                    route: ~
                    route_params: []
                roles: []
        blocks:
            type: ~
            roles: []
            settings:

                # Prototype
                id: ~
            position: right
            class: col-md-4

    default_admin_services:
        model_manager: null
        data_source: null
        form_contractor: null
        show_builder: null
        list_builder: null
        datagrid_builder: null
        translator: null
        configuration_pool: null
        route_generator: null
        validator: null
        security_handler: null
        label: null
        menu_factory: null
        route_builder: null
        label_translator_strategy: null
        pager_type: null

    templates:
        user_block: '@SonataAdmin/Core/user_block.html.twig'
        add_block: '@SonataAdmin/Core/add_block.html.twig'
        layout: '@SonataAdmin/standard_layout.html.twig'
        ajax: '@SonataAdmin/ajax_layout.html.twig'
        dashboard: '@SonataAdmin/Core/dashboard.html.twig'
        search: '@SonataAdmin/Core/search.html.twig'
        list: '@SonataAdmin/CRUD/list.html.twig'
        filter: '@SonataAdmin/Form/filter_admin_fields.html.twig'
        show: '@SonataAdmin/CRUD/show.html.twig'
        show_compare: '@SonataAdmin/CRUD/show_compare.html.twig'
        edit: '@SonataAdmin/CRUD/edit.html.twig'
        preview: '@SonataAdmin/CRUD/preview.html.twig'
        history: '@SonataAdmin/CRUD/history.html.twig'
        acl: '@SonataAdmin/CRUD/acl.html.twig'
        history_revision_timestamp: '@SonataAdmin/CRUD/history_revision_timestamp.html.twig'
        action: '@SonataAdmin/CRUD/action.html.twig'
        select: '@SonataAdmin/CRUD/list__select.html.twig'
        list_block: '@SonataAdmin/Block/block_admin_list.html.twig'
        search_result_block: '@SonataAdmin/Block/block_search_result.html.twig'
        short_object_description: '@SonataAdmin/Helper/short-object-description.html.twig'
        delete: '@SonataAdmin/CRUD/delete.html.twig'
        batch: '@SonataAdmin/CRUD/list__batch.html.twig'
        batch_confirmation: '@SonataAdmin/CRUD/batch_confirmation.html.twig'
        inner_list_row: '@SonataAdmin/CRUD/list_inner_row.html.twig'
        outer_list_rows_mosaic: '@SonataAdmin/CRUD/list_outer_rows_mosaic.html.twig'
        outer_list_rows_list: '@SonataAdmin/CRUD/list_outer_rows_list.html.twig'
        outer_list_rows_tree: '@SonataAdmin/CRUD/list_outer_rows_tree.html.twig'
        base_list_field: '@SonataAdmin/CRUD/base_list_field.html.twig'
        pager_links: '@SonataAdmin/Pager/links.html.twig'
        pager_results: '@SonataAdmin/Pager/results.html.twig'
        tab_menu_template: '@SonataAdmin/Core/tab_menu_template.html.twig'
        knp_menu_template: '@SonataAdmin/Menu/sonata_menu.html.twig'
        form_theme: []
        filter_theme: []

    assets:
        stylesheets:

            # The default stylesheet list:
            - bundles/sonataadmin/app.css

        # stylesheet paths to add to the page in addition to the list above
        extra_stylesheets: []

        # stylesheet paths to remove from the page
        remove_stylesheets: []

        javascripts:

            # The default javascript list:
            - bundles/sonataadmin/app.js

        # javascript paths to add to the page in addition to the list above
        extra_javascripts: []

        # javascript paths to remove from the page
        remove_javascripts: []

    extensions:

        # Prototype
        id:
            global: false
            admins: []
            excludes: []
            implements: []
            extends: []
            instanceof: []
            uses: []
            admin_implements: []
            admin_extends: []
            admin_instanceof: []
            admin_uses: []

    persist_filters: false
    filter_persister: sonata.admin.filter_persister.session
    show_mosaic_button: true

    global_search:
        empty_boxes: show
        admin_route: show

    breadcrumbs:
        child_admin_route: show
This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.
TOC
    Version
    Online Symfony certification, take it now!

    Online Symfony certification, take it now!

    Make sure your project is risk free

    Make sure your project is risk free

    Version:

    Table of Contents

    • Configuration
    • Full Configuration Options

    Symfony footer

    Avatar of alexmart, a Symfony contributor

    Thanks alexmart for being a Symfony contributor

    1 commit • 181 lines changed

    View all contributors that help us make Symfony

    Become a Symfony contributor

    Be an active part of the community and contribute ideas, code and bug fixes. Both experts and newcomers are welcome.

    Learn how to contribute

    Symfony™ is a trademark of Symfony SAS. All rights reserved.

    • What is Symfony?

      • What is Symfony?
      • Symfony at a Glance
      • Symfony Components
      • Symfony Releases
      • Security Policy
      • Logo & Screenshots
      • Trademark & Licenses
      • symfony1 Legacy
    • Learn Symfony

      • Symfony Docs
      • Symfony Book
      • Reference
      • Bundles
      • Best Practices
      • Training
      • eLearning Platform
      • Certification
    • Screencasts

      • Learn Symfony
      • Learn PHP
      • Learn JavaScript
      • Learn Drupal
      • Learn RESTful APIs
    • Community

      • Symfony Community
      • SymfonyConnect
      • Events & Meetups
      • Projects using Symfony
      • Contributors
      • Symfony Jobs
      • Backers
      • Code of Conduct
      • Downloads Stats
      • Support
    • Blog

      • All Blog Posts
      • A Week of Symfony
      • Case Studies
      • Cloud
      • Community
      • Conferences
      • Diversity
      • Living on the edge
      • Releases
      • Security Advisories
      • Symfony Insight
      • Twig
      • SensioLabs Blog
    • Services

      • SensioLabs services
      • Train developers
      • Manage your project quality
      • Improve your project performance
      • Host Symfony projects

      Powered by

    Follow Symfony