Version

Documentation » Admin

6. Routing »

« 4. Architecture

5. Dashboard

The dashboard is the main landing page. By default the dashboard lists the different admin areas available. The admin list is a block defined by the sonata.admin.block.admin_list service. More block can be added, just follow the instruction in the BlockBundle documentation.

If you want to customize the dashboard, add the following code to your application’s config file:

# app/config/config.yml
sonata_admin:
    blocks:
        # display a dashboard block
        - { position: left, type: sonata.admin.block.admin_list }

    dashboard
        groups:
            ... your config ...
The dashboard

The dashboard

5.1. Examples

5.1.1. Set the label group & add all the default items

# app/config/config.yml
sonata_admin:
    dashboard:
        blocks:
            # display a dashboard block
            - { position: left, type: sonata.admin.block.admin_list }

        groups:
            sonata_page:
                label: Page
                items: ~

5.1.2. Set items group

# app/config/config.yml
sonata_admin:
    dashboard:
        blocks:
            # display a dashboard block
            - { position: left, type: sonata.admin.block.admin_list }

        groups:
            sonata_page:
                items:
                    - sonata.page.admin.page

5.1.3. Add a group with all the default items

# app/config/config.yml
sonata_admin:
    dashboard:
        blocks:
            # display a dashboard block
            - { position: left, type: sonata.admin.block.admin_list }

        groups:
            sonata_page: ~

5.1.4. Add some items to a group

# app/config/config.yml
sonata_admin:
    dashboard:
        blocks:
            # display a dashboard block
            - { position: left, type: sonata.admin.block.admin_list }

        groups:
            sonata_page:
                item_adds:
                    - sonata.page.admin.myitem1
                    - sonata.page.admin.myitem2
Dashboard

5.1.5. Display two blocks with different dashboard groups

# app/config/config.yml
sonata_admin:
    dashboard
        blocks:
            # display two dashboard blocks
            - { position: left,  type: sonata.admin.block.admin_list, settings: { groups: [sonata_page1, sonata_page2] } }
            - { position: right, type: sonata.admin.block.admin_list, settings: { groups: [sonata_page3] } }

        groups:
            sonata_page1:
                items:
                    - sonata.page.admin.myitem1
            sonata_page2:
                items:
                    - sonata.page.admin.myitem2
                    - sonata.page.admin.myitem3
            sonata_page3:
                items:
                    - sonata.page.admin.myitem4

Found a typo? Something is wrong in this documentation? Just fork and edit it!