templates.rst 1.0 KB

12345678910111213141516171819202122232425262728
  1. Templates
  2. =========
  3. By default, an Admin class used 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 value if done set, actions templates, should extends a global templates
  11. list: SonataAdminBundle:CRUD:list.html.twig
  12. show: SonataAdminBundle:CRUD:show.html.twig
  13. edit: SonataAdminBundle:CRUD:edit.html.twig
  14. Usage of each template :
  15. * layout : based layout used by the dashboard and an admin class
  16. * ajax : default layout used when an ajax request is performed
  17. * list : the template to use for the list action
  18. * show : the template to use for the show action
  19. * edit : the template to use for the edit and create action
  20. The default values will be set only if the ``Admin::setTemplates`` is not called by the Container.