dongping5230 2014-11-28 15:31
浏览 56
已采纳

在Sonata Admin仪表板中只显示两个管理面板

I am using Sonata Admin in my Symfony 2 project to setup three admin panels to show on my dashboard at /admin/dashboard/. One for Common, Contact and Gallery.

They all work independently, however it appears I am limited to two for some reason as when I add the GalleryBundle line below I lose the CommonBundle admin facility from the dashboard.

# /app/config/config.yml
imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: @AyrshireMinisCommonBundle/Resources/config/admin.yml }
    - { resource: @AyrshireMinisContactBundle/Resources/config/admin.yml }
    - { resource: @AyrshireMinisGalleryBundle/Resources/config/admin.yml }

# Sonata Admin
sonata_admin:
    title:  Ayrshire Minis Admin
    options:
        dropdown_number_groups_per_colums:      3

_I'm aware of the misspelt "columns", this is intentional and is in their documentation.

This is my admin.yml for the GalleryBundle:

services:
    sonata.link.admin.post:
        class: AyrshireMinis\GalleryBundle\Admin\GalleryAdmin
        tags:
            - { name: sonata.admin, manager_type: orm, group: "Gallery", label: "Image" }
        arguments:
            - ~
            - AyrshireMinis\GalleryBundle\Entity\GalleryImage
            - ~
        calls:
            - [ setTranslationDomain, [AyrshireMinisGalleryBundle]]

The third option does not appear in the drop down menu in the nav either:

enter image description here

Oddly now that I have installed User support to Sonata I have three menus (with Users now added) and there are three panels on the dashboard, but yet I can't see the Gallery panel?

  • 写回答

1条回答 默认 最新

  • douxuanyi2813 2014-12-03 17:43
    关注

    I found the problem with this, it was in my GalleryBundle admin.yml (which I had copied from the CommonBundle.

    I had sonata.link.admin.post, so I replaced it with gallery as I imagine it was overwriting it.

    services:
        sonata.gallery.admin.post:
            class: AyrshireMinis\GalleryBundle\Admin\GalleryAdmin
            tags:
                - { name: sonata.admin, manager_type: orm, group: "Gallery", label: "Image" }
            arguments:
                - ~
                - AyrshireMinis\GalleryBundle\Entity\GalleryImage
                - ~
            calls:
                - [ setTranslationDomain, [AyrshireMinisGalleryBundle]]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 对于知识的学以致用的解释
  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败