From 2f33c01f46c5d069042ad6b1c8fec623b6540088 Mon Sep 17 00:00:00 2001 From: NicoHood Date: Mon, 28 Sep 2020 12:59:49 +0200 Subject: [PATCH] Fix checkbox label margin (remove empty label) --- templates/forms/default/field.html.twig | 2 +- templates/forms/fields/checkbox/checkbox.html.twig | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/templates/forms/default/field.html.twig b/templates/forms/default/field.html.twig index e47b2c90..271f016a 100644 --- a/templates/forms/default/field.html.twig +++ b/templates/forms/default/field.html.twig @@ -57,7 +57,7 @@ {% set layout_form_field_outer_classes = layout_form_field_outer_classes|trim ~ ' ' ~ embed_outer_field_classes %} {# Show Label logic #} -{% set show_label = field.label is not same as(false) and field.display_label is not same as(false )%} +{% set show_label = field.label is not same as(false) and field.display_label is not same as(false) and show_label is not same as(false) %} {# Label Classes #} {% set layout_form_field_outer_label_classes = ((form_field_outer_label_classes ?: 'form-label') ~ ' ' ~ field.labelclasses)|trim %} diff --git a/templates/forms/fields/checkbox/checkbox.html.twig b/templates/forms/fields/checkbox/checkbox.html.twig index 79bf8551..8d3ae579 100644 --- a/templates/forms/fields/checkbox/checkbox.html.twig +++ b/templates/forms/fields/checkbox/checkbox.html.twig @@ -1,8 +1,6 @@ +{% set show_label = false %} {% extends "forms/field.html.twig" %} -{% block label %} -{% endblock %} - {% block input %} {% set id = field.id|default(field.name)|hyphenize %}