recipe_overwrite_admin_configuration.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Overwrite Admin Configuration
  2. =============================
  3. Sometime you might want to overwrite some Admin settings from vendors. This recipe will explain how to achieve this operation. However, keep in mind this operation is quite dangerous and might break code.
  4. From the configuration file, you can add a new section named ``admin_services`` with the following templates:
  5. .. code-block:: yaml
  6. sonata_admin:
  7. admin_services:
  8. id.of.admin.service:
  9. # service configuration
  10. model_manager: sonata.admin.manager.doctrine_orm
  11. form_contractor: sonata.admin.builder.doctrine_orm
  12. show_builder: sonata.admin.builder.doctrine_orm
  13. list_builder: sonata.admin.builder.doctrine_orm
  14. datagrid_builder: sonata.admin.builder.doctrine_orm
  15. translator: translator
  16. configuration_pool: sonata.admin.pool
  17. route_generator: sonata.admin.route.default_generator
  18. validator: validator
  19. security_handler: sonata.admin.security.handler
  20. menu_factor: knp_menu.factory
  21. route_builder: sonata.admin.route.path_info
  22. label_translator_strategy: sonata.admin.label.strategy.native
  23. # templates configuration
  24. templates:
  25. # view templates
  26. view:
  27. user_block: mytemplate.twig.html
  28. # form related theme templates => this feature need to be implemented by the Persistency layer of each Admin Bundle
  29. form: [ 'MyTheme.twig.html', 'MySecondTheme.twig.html']
  30. filter: [ 'MyTheme.twig.html', 'MySecondTheme.twig.html']
  31. With these settings you will be able to change default services and templates used by the `id.of.admin.service`` admin instance.