diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 64bd59b..39658a4 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1490,8 +1490,6 @@ function template_preprocess_region(&$variables) { * - element: A render element representing the field. * - attributes: A string containing the attributes for the wrapping div. * - title_attributes: A string containing the attributes for the title. - * - content_attributes: A string containing the attributes for the content's - * div. */ function template_preprocess_field(&$variables, $hook) { $element = $variables['element']; @@ -1519,18 +1517,9 @@ function template_preprocess_field(&$variables, $hook) { $default_attributes = new Attribute; } - // Merge attributes when a multiple-value field has a hidden label. - if ($element['#label_display'] == 'hidden' && $variables['multiple']) { - $variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], $variables['content_attributes']); - } // Merge attributes when a single-value field has a hidden label. if ($element['#label_display'] == 'hidden' && !$variables['multiple'] && is_object($element['#items'][0])) { - $variables['content_attributes'] = NestedArray::mergeDeep($variables['content_attributes'], (array) $element['#items'][0]->_attributes); - $variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], $variables['content_attributes']); - } - // Merge attributes when a single-value field has a visible label. - if ($element['#label_display'] != 'hidden' && !$variables['multiple'] && is_object($element['#items'][0])) { - $element['#items'][0]->_attributes = NestedArray::mergeDeep($variables['content_attributes'], (array) $element['#items'][0]->_attributes); + $variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], (array) $element['#items'][0]->_attributes); } // We want other preprocess functions and the theme implementation to have diff --git a/core/modules/system/templates/field.html.twig b/core/modules/system/templates/field.html.twig index a2fe7d0..d3ddcd2 100644 --- a/core/modules/system/templates/field.html.twig +++ b/core/modules/system/templates/field.html.twig @@ -24,7 +24,6 @@ * - label_hidden: Whether to show the field label or not. * - title_attributes: HTML attributes for the title. * - label: The label for the field. - * - content_attributes: HTML attributes for the content. * - multiple: TRUE if a field can contain multiple items. * - items: List of all the field items. Each item contains: * - attributes: List of HTML attributes for each item. @@ -55,7 +54,7 @@ {{ label }}: {% if multiple %} - +
{% endif %} {% for item in items %} {{ item.content }}
diff --git a/core/themes/bartik/templates/field--node--field-tags.html.twig b/core/themes/bartik/templates/field--node--field-tags.html.twig index aeab00b..dab4094 100644 --- a/core/themes/bartik/templates/field--node--field-tags.html.twig +++ b/core/themes/bartik/templates/field--node--field-tags.html.twig @@ -40,7 +40,7 @@ {% if not label_hidden %} {{ label }} {% endif %} - +