简体   繁体   English

如何在Sonata Admin仪表板上显示用户管理链接?

[英]How can I display User Management links on the Sonata Admin dashboard?

I'd like to render the links to user management and ACL editing on my SonataAdmin Dashboard. 我想在SonataAdmin仪表板上呈现指向用户管理和ACL编辑的链接。 What do I need to add to sonata_block section? 我需要在sonata_block部分添加什么? Also, what are these 'cms' and 'admin' contexts? 另外,这些“ cms”和“ admin”上下文是什么?

sonata_block:
    default_contexts: [cms]
    blocks:
        # Enable the SonataAdminBundle block
        sonata.admin.block.admin_list:
            contexts:   [admin]
        # Your other blocks
        sonata.user.block.menu: ~    # used to display the menu in profile pages
        sonata.user.block.account: ~ # used to display menu option (login option)
        sonata.block.service.text: ~
        sonata.block.service.rss: ~
        sonata.block.service.imagesize:
            contexts: [admin]
    groups:
        admin.group.content:
            label: My Label
            label_catalogue: SonataAdminBundle
            items:
                - sonata.admin.????

Please note, the cms context will be renamed into sonata_page_bundle to be more appropriate. 请注意,cms上下文将重命名为sonata_page_bundle以使其更合适。

Each block can be defined in a specific context (ie, an admin related block does not need to be added as a cms block). 可以在特定上下文中定义每个块(即,无需将与admin相关的块添加为cms块)。

So if we set a context to a block, the default value will not be applied and so the block will be not listed in the SonataPageBundle or any other bundles using this context. 因此,如果我们为块设置上下文,则不会应用默认值,因此该块不会在使用此上下文的SonataPageBundle或任何其他捆绑包中列出。

Now, if you want to add content into the dashboard, you have some options: - overwrite the dashboard template so you can fine tune the overall layout and add link to the user management. 现在,如果要向仪表板中添加内容,则有一些选择:-覆盖仪表板模板,以便您可以微调总体布局并添加指向用户管理的链接。 - create a block and add it to the block configuration of the sonata_admin section. -创建一个块并将其添加到sonata_admin节的块配置中。

You can create a new block by following the BlockBundle tutorial available at: http://sonata-project.org/bundles/block/master/doc/reference/your_first_block.html 您可以按照以下网站上的BlockBundle教程创建新的块: http ://sonata-project.org/bundles/block/master/doc/reference/your_first_block.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM