diff --git a/core/themes/classy/templates/system/fieldset.html.twig b/core/themes/classy/templates/system/fieldset.html.twig index ab6796c..0823204 100644 --- a/core/themes/classy/templates/system/fieldset.html.twig +++ b/core/themes/classy/templates/system/fieldset.html.twig @@ -5,6 +5,7 @@ * * Available variables: * - attributes: HTML attributes for the fieldset element. + * - errors: (optional) Any errors for this fieldset element, may not be set. * - required: Boolean indicating whether the fieldeset element is required. * - legend: The legend element containing the following properties: * - title: Title of the fieldset, intended for use as the text of the legend. @@ -21,7 +22,19 @@ * @ingroup themeable */ #} - +{% + set classes = [ + 'form-item', + 'form-wrapper', + errors ? 'form-error', + ] +%} + + {% if errors %} +
+ {{ errors }} +
+ {% endif %} {% set legend_span_classes = [ 'fieldset-legend', diff --git a/core/themes/classy/templates/system/form-element.html.twig b/core/themes/classy/templates/system/form-element.html.twig index a961801..f9148c8 100644 --- a/core/themes/classy/templates/system/form-element.html.twig +++ b/core/themes/classy/templates/system/form-element.html.twig @@ -5,6 +5,7 @@ * * Available variables: * - attributes: HTML attributes for the containing element. + * - errors: (optional) Any errors for this form element, may not be set. * - prefix: (optional) The form element prefix, may not be set. * - suffix: (optional) The form element suffix, may not be set. * - required: The required marker, or empty if the associated form element is @@ -52,6 +53,7 @@ 'form-item-' ~ name|clean_class, title_display not in ['after', 'before'] ? 'form-no-label', disabled == 'disabled' ? 'form-disabled', + errors ? 'form-error', ] %} {% @@ -61,6 +63,11 @@ ] %} + {% if errors %} +
+ {{ errors }} +
+ {% endif %} {% if label_display in ['before', 'invisible'] %} {{ label }} {% endif %}