sonata-admin
Programmatically set the value of a Select2 ajax
Note this was tested with version 4+ I was finally able to make progress after finding this discussion: https://groups.google.com/forum/#!topic/select2/TOh3T0yqYr4 The last comment notes a method that I was able to use successfully. Example: $(“#selectelement”).select2(“trigger”, “select”, { data: { id: “5” } }); This seems to be enough information for it to match the ajax data, … Read more
SonataAdminBundle custom rendering of text fields in list
The solution: I’ve defined a custom html type in the config.yml for sonata_doctrine_orm_admin: sonata_doctrine_orm_admin: templates: types: list: html: MyBundle:Default:list_html.html.twig And created the custom list_html.html.twig template in which i do not escape HTML: {% extends ‘SonataAdminBundle:CRUD:base_list_field.html.twig’ %} {% block field%} {{value|raw}} {% endblock %} Now in the PostAdmin I can define the behaviour of the field … Read more