diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 2358edf..cdf5013 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -412,6 +412,10 @@ function template_preprocess_field(&$variables, $hook) { $variables['title_attributes'] = isset($variables['title_attributes']) ? new Attribute($variables['title_attributes']) : clone($default_attributes); $variables['content_attributes'] = isset($variables['content_attributes']) ? new Attribute($variables['content_attributes']) : clone($default_attributes); + if (count($variables['items']) > 1 ) { + $variables['multiple'] = TRUE; + } + // Modules (e.g., rdf.module) can add field item attributes (to // $item->_attributes) within hook_entity_prepare_view(). Some field // formatters move those attributes into some nested formatter-specific diff --git a/core/modules/field/templates/field.html.twig b/core/modules/field/templates/field.html.twig index a0d527a..d4626b1 100644 --- a/core/modules/field/templates/field.html.twig +++ b/core/modules/field/templates/field.html.twig @@ -16,6 +16,7 @@ * - field.html.twig * * Available variables: + * - multiple: TRUE for multiples values in the field. * - attributes: HTML attributes for the containing element. * - label_hidden: Whether to show the field label or not. * - title_attributes: HTML attributes for the title. @@ -31,11 +32,16 @@ #}