templates.rst 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Templates
  2. =========
  3. You can customize the global layout by tweaking the ``SonataAdminBundle`` 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. You can also configure the templates used by the Form Framework while rendering the widget
  15. .. code-block:: yaml
  16. sonata_doctrine_orm_admin:
  17. templates:
  18. form: [ SonataDoctrineORMAdminBundle:Form:form_admin_fields.html.twig ]
  19. filter: [ SonataDoctrineORMAdminBundle:Form:filter_admin_fields.html.twig ]
  20. You can also customize field types
  21. .. code-block:: yaml
  22. sonata_doctrine_orm_admin:
  23. templates:
  24. types:
  25. list:
  26. date: SonataAdminBundle:CRUD:date_field.html.twig
  27. datetime: SonataAdminBundle:CRUD:datetime_field.html.twig
  28. .. note::
  29. By default, if the ``SonataIntlBundle`` classes are availables, then the numeric and date fields will be
  30. localized with the current user locale (only for list, work in progress).