简体   繁体   中英

Remove Symfony CMF content type options from Sonata Admin Menu

Currently I have a dashboard and menu in the Sonata Admin backend which is a combination of my own entities and those which came with Symfony CMF. Ideally I would like to remove the Symfony CMF group as it's not currently used on the site and may lead my client down the wrong path when they use the system.

However I'm struggling to workout out where in the config I have to make this change.

My menu currently looks like this:

- Users (group)
- Products (group)
- Knowledge Base (group)
- RMA Tickets (group)
- Support Tickets (group)
- Symfony CMF (group)
    - Static Content
    - Pages
    - Simple Block
    ...

I want to remove the whole Symfony CMF group from the menu.

If you do not need sonata admin for the cmf parts of the system at all, your easiest solution is to disable them. The easiest to do that is

# app/config/config.yml
cmf_core:
    persistence:
        phpcr:
            use_sonata_admin: false

By default, the admins are enabled automatically if sonata is available. If you do not have any PHPCR documents to admin, you might also remove sonata-project/doctrine-phpcr-admin-bundle from composer.json.

In case you do need some of the CMF admin functionalities, you can also specifically control what is on the dashboard. See https://sonata-project.org/bundles/admin/master/doc/reference/dashboard.html

And finally, you could use Sonata Security to control who sees what admins, if some people need to be able to edit pages through sonata, but others don't.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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