{% if not label_hidden %}
-
{{ label }}:
+
{{ label }}:
{% endif %}
-
- {% for delta, item in items %}
-
{{ item }}
+
+ {% for item in items %}
+
{{ item.value }}
{% endfor %}
diff --git a/core/themes/bartik/templates/field--taxonomy-term-reference.html.twig b/core/themes/bartik/templates/field--taxonomy-term-reference.html.twig
index 4c579ee..d97c20b 100644
--- a/core/themes/bartik/templates/field--taxonomy-term-reference.html.twig
+++ b/core/themes/bartik/templates/field--taxonomy-term-reference.html.twig
@@ -9,20 +9,26 @@
* - title_attributes: HTML attributes for the label.
* - label: The label for the field.
* - content_attributes: HTML attributes for the content.
- * - items: List of all the field items.
- * - item_attributes: List of HTML attributes for each item.
+ * - items: List of all the field items. Each item contains:
+ * - attributes: List of HTML attributes for each item.
+ * - value: The field item's value.
*
* @see template_preprocess_field()
* @see bartik_preprocess_field()
*/
#}
-
+
{% if not label_hidden %}
{{ label }}:
{% endif %}
-
+
{% for delta, item in items %}
- - {{ item }}
+ {%
+ set item_classes = [
+ 'taxonomy-term-reference-' ~ delta,
+ ]
+ %}
+ - {{ item.value }}
{% endfor %}