Search code examples
symfonysonata-admin

Position of the entities in the sonata dashboard


I would like to know how to make sure that the element of my dashboard is on the right side as in the following image:

enter image description here

At the code level, I entered my entities in the services.yml file as in the tutorial. On the other hand I do not know how to recover my entity in the file config.yml.

For now in the file confi.yml I have this:

dashboard:
    blocks:

        // - - - - - - - - - - - - - - - - 
        -
            position: left
            type: sonata.admin.block.admin_list

I thank you in advance


Solution

  • It is necessary that in your config you do this:

    -
                position: left
                type: sonata.admin.block.admin_list
                settings:
                    groups: [sonata_page1]
            -
                position: right
                type: sonata.admin.block.admin_list
                settings:
                    groups: [sonata_page2]
        groups:
            sonata_page1:
                items:
                    - admin.benevole
    
            sonata_page2:
                items:
                    - admin.patient
    

    Look at this link: Here