templates.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 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. 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. time: SonataAdminBundle:CRUD:list_time.html.twig
  30. datetime: SonataAdminBundle:CRUD:list_datetime.html.twig
  31. text: SonataAdminBundle:CRUD:base_list_field.html.twig
  32. trans: SonataAdminBundle:CRUD:list_trans.html.twig
  33. string: SonataAdminBundle:CRUD:base_list_field.html.twig
  34. smallint: SonataAdminBundle:CRUD:base_list_field.html.twig
  35. bigint: SonataAdminBundle:CRUD:base_list_field.html.twig
  36. integer: SonataAdminBundle:CRUD:base_list_field.html.twig
  37. decimal: SonataAdminBundle:CRUD:base_list_field.html.twig
  38. identifier: SonataAdminBundle:CRUD:base_list_field.html.twig
  39. show:
  40. array: SonataAdminBundle:CRUD:show_array.html.twig
  41. boolean: SonataAdminBundle:CRUD:show_boolean.html.twig
  42. date: SonataAdminBundle:CRUD:show_date.html.twig
  43. time: SonataAdminBundle:CRUD:show_time.html.twig
  44. datetime: SonataAdminBundle:CRUD:show_datetime.html.twig
  45. text: SonataAdminBundle:CRUD:base_show_field.html.twig
  46. trans: SonataAdminBundle:CRUD:show_trans.html.twig
  47. string: SonataAdminBundle:CRUD:base_show_field.html.twig
  48. smallint: SonataAdminBundle:CRUD:base_show_field.html.twig
  49. bigint: SonataAdminBundle:CRUD:base_show_field.html.twig
  50. integer: SonataAdminBundle:CRUD:base_show_field.html.twig
  51. decimal: SonataAdminBundle:CRUD:base_show_field.html.twig
  52. .. note::
  53. By default, if the ``SonataIntlBundle`` classes are available, then the numeric and date fields will be
  54. localized with the current user locale.