3

Can't add custom template to sonata_type_model many_to_many relation. I want to override standart template edit_orm_many_to_many.html.twig

Wrote something like this:

        ->add('forms', 'sonata_type_model', array('expanded' => true,
                                                  'multiple' => true,
                                                  'query' => $query,
                                                  'template' => 'MyBundle:Default:edit_orm_many_to_many.html.twig'
                                                  ));

But I can't recieve any reaction. I can add 'template' => 'qwe' and I still see standart template, notify about errors not appear. Looks like option template not working.

UPDATE: Any ideas will very useful

user1156168
  • 936
  • 13
  • 32

1 Answers1

0

You can't change template in formMapper. This dosen't works that way with forms. You need to use form theming. Check this out Sonata Admin Bundle - Form type: sonata_type_collection - custom template? or this: https://github.com/sonata-project/SonataAdminBundle/issues/1104

Community
  • 1
  • 1
tiriana
  • 668
  • 1
  • 7
  • 24