Admin Bundle ~ Enhancing your dashboard

The dashboard is the main entry point to your backend, it should reflect the most important data of your application. Let's see some tips to make it better.

Don't use the default dashboard!

You can configure the dashboard template with the dashboard key in the templates in the configuration file. Once, you have changed the template you can add any elements you want: google chart, components, tables and blocks

What is the best way to add components inside the dashboard ?

The default dashboard is based on the BlockBundle to render each component. A block represents the configuration data used by a BlockService to render the component. So the dashboard is a set of block with one purpose: list latest actions, list latest news, etc ... you can actually create and add any kind of block in the dashboard.

If you want to know how to create a block, review this tutorial: Your First Block. And if you want to understand the syntax of the block twig helper, please review the related documention

As a side note, a block can be reuse a block with the PageBundle or the CMF project

What can I do with the default dashboard ?

The first version of the dashboard was originally built with 2 columns, which is not very nice as the interface get a bit confusing with too large component ... The latest version can now handle a third column: center. This will make the dashboard a lot more compact and useful. So you now have 3 default positions: left, center and right. The default configuration from the sandbox will look like this :

    blocks:
        - { position: left, type: sonata.admin.block.admin_list }
        - { position: center, type: sonata.block.service.text, settings: { content: "<h2>Welcome!</h2> You can customize this dashboard by editing the sonata_admin.yml file. The current dashboard presents the recent items from the NewsBundle and a timeline with the latest action"} }
        - { position: center, type: sonata.timeline.block.timeline, settings: { context: SONATA_ADMIN, max_per_page: 25 }}
        - { position: right, type: sonata.news.block.recent_posts, settings: { title: Recent Posts, number: 7, mode: admin }}
        - { position: right, type: sonata.news.block.recent_comments, settings: { title: Recent Comments, number: 7, mode: admin }}
        - { position: right, type: sonata.block.service.rss, settings: { title: Sonata Project's Feeds, url: http://sonata-project.org/blog/archive.rss }}

Depends on your needs, you can mix this configuration with you custom dashboard twig template.

The new default dashboard looks like this:

Dashboard 3 columns

Comments

  • No comments available
The comment form is closed for this current news.