dashboard.rst 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. Dashboard
  2. =========
  3. The dashboard is the main landing page. By default the dashboard lists the different admin areas available.
  4. The admin list is a block defined by the ``sonata.admin.block.admin_list`` service. More block can be added, just
  5. follow the instruction in the `BlockBundle documentation <http://sonata-project.org/bundles/block/master/doc/index.html>`_.
  6. If you want to customize the dashboard, add the following code to your
  7. application's config file:
  8. .. code-block:: yaml
  9. # app/config/config.yml
  10. sonata_admin:
  11. blocks:
  12. # display a dashboard block
  13. - { position: left, type: sonata.admin.block.admin_list }
  14. dashboard
  15. groups:
  16. ... your config ...
  17. Examples
  18. --------
  19. Set the label group & add all the default items
  20. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  21. .. code-block:: yaml
  22. # app/config/config.yml
  23. sonata_admin:
  24. dashboard:
  25. blocks:
  26. # display a dashboard block
  27. - { position: left, type: sonata.admin.block.admin_list }
  28. groups:
  29. sonata_page:
  30. label: Page
  31. items: ~
  32. Set items group
  33. ^^^^^^^^^^^^^^^
  34. .. code-block:: yaml
  35. # app/config/config.yml
  36. sonata_admin:
  37. dashboard:
  38. blocks:
  39. # display a dashboard block
  40. - { position: left, type: sonata.admin.block.admin_list }
  41. groups:
  42. sonata_page:
  43. items:
  44. - sonata.page.admin.page
  45. Add a group with all the default items
  46. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  47. .. code-block:: yaml
  48. # app/config/config.yml
  49. sonata_admin:
  50. dashboard
  51. blocks:
  52. # display a dashboard block
  53. - { position: left, type: sonata.admin.block.admin_list }
  54. groups:
  55. sonata_page: ~
  56. Add some items to a group
  57. ^^^^^^^^^^^^^^^^^^^^^^^^^
  58. .. code-block:: yaml
  59. # app/config/config.yml
  60. sonata_admin:
  61. dashboard:
  62. blocks:
  63. # display a dashboard block
  64. - { position: left, type: sonata.admin.block.admin_list }
  65. groups:
  66. sonata_page:
  67. item_adds:
  68. - sonata.page.admin.myitem1
  69. - sonata.page.admin.myitem2
  70. .. image:: ../images/dashboard.png
  71. :alt: Dashboard
  72. :width: 200