从sonata-admin的侧边菜单中删除子管理员

时间:2014-12-18 15:18:06

标签: php symfony sonata-admin symfony-sonata

我在sonata-admin中有一个EmployeeAdmin,配置了三个子管理员:

sonata.admin.employee:
    class: Medicina\InasistenciasBundle\Admin\EmployeeAdmin
    tags:
        - { name: sonata.admin, manager_type: orm, group: "Contenido", label: "Empleados", label_translator_strategy: "sonata.admin.label.strategy.underscore" }
    arguments:
        - ~
        - Medicina\InasistenciasBundle\Entity\Employee
        - MedicinaInasistenciasBundle:EmployeeCRUD
    calls:
        - [ setTranslationDomain, [MedicinaInasistenciasBundle]]
        - [ addChild, [@sonata.admin.compensatory_part]]
        - [ addChild, [@sonata.admin.compensatory]]
        - [ addChild, [@sonata.admin.absence]]
儿童管理员几乎都是一样的,其中一个是:

 sonata.admin.compensatory_part:
    class: Medicina\InasistenciasBundle\Admin\CompensatoryPartAdmin
    tags:
        - { name: sonata.admin, manager_type: orm, group: "Contenido", label: "Módulos de Tiempo",label_translator_strategy: "sonata.admin.label.strategy.underscore" }
    arguments:
        - ~
        - Medicina\InasistenciasBundle\Entity\CompensatoryPart
        - MedicinaInasistenciasBundle:DeleteValidationCRUD
    calls:
        - [setTranslationDomain, [MedicinaInasistenciasBundle]]

如何避免子模板出现在奏鸣曲侧边菜单中?

screenshot of sonata menu

我尝试删除群组标签标签,但是奏鸣曲只是将它们粘贴在'默认'没有名字的小组。我确信这是微不足道的,但我似乎无法在文档中找到它。有什么想法吗?

1 个答案:

答案 0 :(得分:7)

show_in_dashboard: false标记添加到您要从菜单中排除的管理服务中。

tags:
    - { name: sonata.admin, manager_type: orm, group: "Contenido", label: "Módulos de Tiempo",label_translator_strategy: "sonata.admin.label.strategy.underscore", show_in_dashboard: false }

保留grouplabel代码,以便它们在集合中正确显示并输入管理员!