templates.rst 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. Templates
  2. =========
  3. By default, an Admin class uses a set of templates, it is possible to tweak the default values by editing the configuration
  4. .. code-block:: yaml
  5. sonata_admin:
  6. templates:
  7. # default global templates
  8. layout: SonataAdminBundle::standard_layout.html.twig
  9. ajax: SonataAdminBundle::ajax_layout.html.twig
  10. # default values of actions templates, they should extend global templates
  11. list: SonataAdminBundle:CRUD:list.html.twig
  12. show: SonataAdminBundle:CRUD:show.html.twig
  13. edit: SonataAdminBundle:CRUD:edit.html.twig
  14. history: SonataAdminBundle:CRUD:history.html.twig
  15. Usage of each template :
  16. * layout : base layout used by the dashboard and an admin class
  17. * ajax : default layout used when an ajax request is performed
  18. * dashboard: default layout used at the dashboard
  19. * list : the template to use for the list action
  20. * show : the template to use for the show action
  21. * edit : the template to use for the edit and create action
  22. * history : the template to use for the history / audit action
  23. The default values will be set only if the ``Admin::setTemplates`` is not called by the Container.