Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Better fragment data formatter (#136)
Browse files Browse the repository at this point in the history
* Better fragment data formatter

* Update src/Resources/views/FragmentAdmin/form.html.twig

Co-Authored-By: Grégoire Paris <postmaster@greg0ire.fr>
  • Loading branch information
2 people authored and core23 committed Nov 14, 2019
1 parent 8dc52e7 commit b3ee64c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Resources/views/FragmentAdmin/form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
{% set fragmentLabel = 'fragment'|trans({}, 'SonataArticleBundle') %}
<div data-fragment-form="{{ form.vars.id }}"
data-form-tmp="true"
data-formdata='{ "name": "{{ fragmentLabel }} {{ fragmentName|escape }}", "type": "{{ form.vars.data.backofficeTitle|trans({}, 'SonataArticleBundle') }}" }'
data-formdata="{{ {
'name': fragmentLabel ~ ' ' ~ fragmentName|escape,
'type' : form.vars.data.backofficeTitle|trans({}, 'SonataArticleBundle')
}|json_encode() }}"
data-errors="{{ form.vars.errors|length }}">
<div class="col-md-12">
<div class="box box-primary">
Expand Down

0 comments on commit b3ee64c

Please sign in to comment.