简体   繁体   English

在sonata-admin中从sidemenu中删除子管理员

[英]Remove child admins from sidemenu in sonata-admin

I have one EmployeeAdmin in sonata-admin, configured with three child admins: 我在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]]

the child admins are all pretty much the same, here's one of them: 孩子的管理员几乎都是一样的,这里有一个:

 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]]

How can I avoid the child templates from showing up in sonatas side menu? 如何避免子模板出现在sonatas侧面菜单中?

奏鸣曲菜单的屏幕截图

I have tried removing the group and label tags, but then sonata just sticks them in an 'Default' group with no name. 我试过删除标签标签,但是奏鸣曲只是将它们粘贴在没有名称的“默认”组中。 I'm sure is something trivial, but I can't seem to find it in the documentation. 我敢肯定这是一件微不足道的事情,但是我似乎无法在文档中找到它。 Any ideas? 有任何想法吗?

Add the show_in_dashboard: false tag to the Admin services you wish to exclude from the menu. show_in_dashboard: false标记添加到您希望从菜单中排除的Admin服务中。

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 }

Keep the group and label tags so they show up correctly in collections and type admins! 保留grouplabel标签,以便它们正确显示在集合中并键入admins!

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

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