Search code examples
symfonysonata

Sonata Admin: Multiple list tables in one page


I`ve 3 entities: Project, Campaign and AdGroupId (Adwords project) and they have One To Many relations: Project => Campaign => AdGroupId. In Project list I added custom button, which redirects to Campaign list and shows all Campaigns by Project id. Campaign have same button for AdGroups. Is it possible to show Campaign list table just below Project list table by pressing on button and same for adgroup (3rd list table below Campaigns)?


Solution

  • Not directly.

    Option 1 Sonata Blocks

    You can build your own blocks and use sonata admin as part of a block: https://sonata-project.org/bundles/block/master/doc/reference/installation.html

    Then you can have a block that renders Projects list and add it to the Campaign list view or the other way around.

    Option 2 Ajax

    Sonata admin views and controllers are designed to be loaded and work well with ajax. On a ajax call they have a different render. You can have a look as an alternative to the sonata blocks.