I'm working on Symfony2 and SonataAdminBundle.
I need to know how to add a menu in the left part of my dashboard ? Like in the screen :
I need to have the Dashboard block in the left part on the page (in dark-grey on my screen).. how can i do that ?
you can see on the demo of SonataAdmin http://demo.sonata-project.org/admin/dashboard, login admin, apssword admin
http://blog.eike.se/2014/03/custom-page-controller-in-sonata-admin.html
this post helped me.
extend template
vendor/sonata-project/admin-bundle/Resources/views/standard_layout.html.twig
override block
{% extends 'SonataAdminBundle::standard_layout.html.twig' %}
{% block side_bar_after_nav %}
YOUR CUSTOM MENU
{% endblock %}
I've just added ROLE_SONATA_ADMIN to ROLE_ADMIN in security.yml:
security:
role_hierarchy:
ROLE_ADMIN: [ROLE_USER, ROLE_SONATA_ADMIN]
and it shown up, finaly. For more info check this: https://github.com/sonata-project/SonataAdminBundle/issues/2321
The first thing to do is to open this file in this path:
\wamp\www\YourProject\vendor\sonata-project\admin-bundle\Resources\view \standard_layout.html.twig
Then look for :ROLE_SONATA_ADMIN
(using Ctrl+F) then changed to the role that you are using to log in to your admin dashboard for me I'm using ROLE_ADMIN
, then save the file, close it, check your admin dashboard, you will find exactly what you look for.
hope it will works
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With