Fixed template horizontal form theme for ckeditor comments fields with fullWidth parameter

Notes:
The 'fullwidth' parameter allow to force enlarge textarea ckeditor field,
escaping horizontal bootstrap theme position rule (4/12 - 8/12)
This commit is contained in:
Mathieu Jaumotte 2023-03-07 10:54:36 +01:00
parent c953da3fd0
commit ef3b41fa90
3 changed files with 32 additions and 46 deletions

View File

@ -56,12 +56,7 @@ class CommentType extends AbstractType
public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars = array_replace(
$view->vars,
[
'fullWidth' => true,
]
);
$view->vars['fullWidth'] = true;
}
public function configureOptions(OptionsResolver $resolver)

View File

@ -95,12 +95,7 @@ class ScopePickerType extends AbstractType
public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars = array_replace(
$view->vars,
[
'fullWidth' => true,
]
);
$view->vars['fullWidth'] = true;
}
public function configureOptions(OptionsResolver $resolver)

View File

@ -18,9 +18,9 @@
{% block form_row %}
{% apply spaceless %}
{% if form.vars.fullWidth is not defined or form.vars.fullWidth == false %}
<div class="mb-2">
<div class="row">
{% if form.vars.fullWidth is not defined or form.vars.fullWidth == false %} {# here #}
<div class="{% apply spaceless %}
{% if attr.class is defined and ('cf-title' in attr.class or 'cf-fields' in attr.class ) %}
col-sm-12
@ -48,11 +48,12 @@
{{ form_widget(form) }}
{{ form_errors(form) }}
</div>
</div>
</div>
{% else %}
{{ form_widget(form) }}
<div class="col-12 clear">{{ form_label(form) }}</div>
<div class="col-12">{{ form_widget(form) }}</div>
{% endif %}
</div>
</div>
{% endapply %}
{% endblock form_row %}
@ -210,11 +211,6 @@
{% endfor %}
{% endblock %}
{% block comment_row %}
{{ form_label(form) }}
{{ form_row(form) }}
{% endblock %}
{% block comment_widget %}
{% for entry in form %}
{{ form_widget(entry) }}