Question

I have no luck with getting Sonata Admin to work.

My configuration:

#app/config/config.yml

JobeetBundle:
    resource: "@JobeetBundle/Resources/config/routing.yml"
    prefix:   /

admin:
    resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
    prefix: /admin

_sonata_admin:
    resource: .
    type: sonata_admin
    prefix: /admin

#JobeetBundle/Resources/config/services.yml

  sonata.admin.job:
    class: Marek\JobeetBundle\Admin\JobAdmin
    tags:
      - { name: sonata.admin, manager_type: orm, group: jobeet, label: job }
    arguments: [null,  Marek\JobeetBundle\Entity\Job, MarekJobeetBundle:JobAdmin]

URL: admin/dashboard

All I see is sonata project logo and title "Dashboard" on this page. Ofcourse I cleared cache. JobAdmin class extends Sonata\AdminBundle\Admin\Admin.

I have no errors, logs seems to be ok.

Could somebody give me any advice?

[EDIT]

It's still doesn't work admin/dashboard is the same, however I have access to listing etc from url's like:

/admin/marek/jobeet/job/list

Was it helpful?

Solution

Add the following to app/config/config.yml

#app/config/config.yml
dashboard_groups:
    marek_job:
      label: Jobs
      items: [sonata.admin.job]

If you are still having problems try the following in your console:

php app/console sonata:admin:explain sonata.admin.job

OTHER TIPS

I commented out everything under sonata_admin.dashboard.groups and got it working that way. The default value I got from the tutorials was

    groups:
        default: ~

Even little old question&answers, I have got the same/similar issue in the latest sonata-admin (3.23.0) = empty dashboard and global search when using dashboard/groups in app/config/config.yml.

The key is not well documented - there is a difference using

groups:
    orders:
        items:
            - sonata.admin.something

which creates menu item incl. dashboard links and

groups:
    orders:
        items:
            - route: admin_something_list

which creates the same menu item, however dashboard and global search are empty as the service looks admin-incompatible.. Hope this helps others too :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top