From 0a8a33df60cd6e4f79e3b08505813c48b43a7880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Mon, 30 Sep 2019 18:47:27 -0400 Subject: [PATCH] Override container direct from stable theme because that's where html actually is --- .../elements/container--more-link.html.twig | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/web/themes/custom/geofresco/src/templates/elements/container--more-link.html.twig b/web/themes/custom/geofresco/src/templates/elements/container--more-link.html.twig index ec1b750..0da6c38 100644 --- a/web/themes/custom/geofresco/src/templates/elements/container--more-link.html.twig +++ b/web/themes/custom/geofresco/src/templates/elements/container--more-link.html.twig @@ -1,3 +1,28 @@ -{% extends "@stable/form/container.html.twig" %} - -{% set attributes = attributes.addClass("field") %} +{# +/** + * @file + * Theme override of a container used to wrap child elements. + * + * Used for grouped form items. Can also be used as a theme wrapper for any + * renderable element, to surround it with a
and HTML attributes. + * See \Drupal\Core\Render\Element\RenderElement for more + * information on the #theme_wrappers render array property, and + * \Drupal\Core\Render\Element\container for usage of the container render + * element. + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - children: The rendered child elements of the container. + * - has_parent: A flag to indicate that the container has one or more parent + containers. + * + * @see template_preprocess_container() + */ +#} +{% + set classes = [ + has_parent ? 'js-form-wrapper', + has_parent ? 'form-wrapper', + ] +%} +{{ children }}