templates.rst 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 by adding types in the ``config.yml`` file. The default values are :
  21. .. code-block:: yaml
  22. sonata_doctrine_orm_admin:
  23. templates:
  24. types:
  25. list:
  26. array: SonataAdminBundle:CRUD:list_array.html.twig
  27. boolean: SonataAdminBundle:CRUD:list_boolean.html.twig
  28. date: SonataAdminBundle:CRUD:list_date.html.twig
  29. datetime: SonataAdminBundle:CRUD:list_datetime.html.twig
  30. text: SonataAdminBundle:CRUD:base_list_field.html.twig
  31. trans: SonataAdminBundle:CRUD:list_trans.html.twig
  32. string: SonataAdminBundle:CRUD:base_list_field.html.twig
  33. smallint: SonataAdminBundle:CRUD:base_list_field.html.twig
  34. bigint: SonataAdminBundle:CRUD:base_list_field.html.twig
  35. integer: SonataAdminBundle:CRUD:base_list_field.html.twig
  36. decimal: SonataAdminBundle:CRUD:base_list_field.html.twig
  37. identifier: SonataAdminBundle:CRUD:base_list_field.html.twig
  38. show:
  39. array: SonataAdminBundle:CRUD:show_array.html.twig
  40. boolean: SonataAdminBundle:CRUD:show_boolean.html.twig
  41. date: SonataAdminBundle:CRUD:show_date.html.twig
  42. datetime: SonataAdminBundle:CRUD:show_datetime.html.twig
  43. text: SonataAdminBundle:CRUD:base_show_field.html.twig
  44. trans: SonataAdminBundle:CRUD:show_trans.html.twig
  45. string: SonataAdminBundle:CRUD:base_show_field.html.twig
  46. smallint: SonataAdminBundle:CRUD:base_show_field.html.twig
  47. bigint: SonataAdminBundle:CRUD:base_show_field.html.twig
  48. integer: SonataAdminBundle:CRUD:base_show_field.html.twig
  49. decimal: SonataAdminBundle:CRUD:base_show_field.html.twig
  50. .. note::
  51. By default, if the ``SonataIntlBundle`` classes are availables, then the numeric and date fields will be
  52. localized with the current user locale.