field-multiple-value-form.html.twig
Same filename in this branch
- 11.x core/themes/olivero/templates/form/field-multiple-value-form.html.twig
- 11.x core/themes/claro/templates/form/field-multiple-value-form.html.twig
- 11.x core/themes/starterkit_theme/templates/form/field-multiple-value-form.html.twig
- 11.x core/modules/system/templates/field-multiple-value-form.html.twig
Same filename in other branches
- 9 core/themes/olivero/templates/form/field-multiple-value-form.html.twig
- 9 core/themes/stable9/templates/form/field-multiple-value-form.html.twig
- 9 core/themes/claro/templates/form/field-multiple-value-form.html.twig
- 9 core/themes/stable/templates/form/field-multiple-value-form.html.twig
- 9 core/themes/starterkit_theme/templates/form/field-multiple-value-form.html.twig
- 9 core/themes/classy/templates/form/field-multiple-value-form.html.twig
- 9 core/modules/system/templates/field-multiple-value-form.html.twig
- 8.9.x core/themes/claro/templates/form/field-multiple-value-form.html.twig
- 8.9.x core/themes/stable/templates/form/field-multiple-value-form.html.twig
- 8.9.x core/themes/classy/templates/form/field-multiple-value-form.html.twig
- 8.9.x core/modules/system/templates/field-multiple-value-form.html.twig
- 10 core/themes/olivero/templates/form/field-multiple-value-form.html.twig
- 10 core/themes/stable9/templates/form/field-multiple-value-form.html.twig
- 10 core/themes/claro/templates/form/field-multiple-value-form.html.twig
- 10 core/themes/starterkit_theme/templates/form/field-multiple-value-form.html.twig
- 10 core/modules/system/templates/field-multiple-value-form.html.twig
Theme override for an individual form element.
Available variables for all fields:
- multiple: Whether there are multiple instances of the field.
Available variables for single cardinality fields:
- elements: Form elements to be rendered.
Available variables when there are multiple fields.
- table: Table of field items.
- description: The description element containing the following properties:
- content: The description content of the form element.
- attributes: HTML attributes to apply to the description container.
- button: "Add another item" button.
See also
template_preprocess_field_multiple_value_form()
1 theme call to field-multiple-value-form.html.twig
- WidgetBase::formMultipleElements in core/
lib/ Drupal/ Core/ Field/ WidgetBase.php - Special handling to create form elements for multiple values.
File
-
core/
themes/ stable9/ templates/ form/ field-multiple-value-form.html.twig
View source
- {#
- /**
- * @file
- * Theme override for an individual form element.
- *
- * Available variables for all fields:
- * - multiple: Whether there are multiple instances of the field.
- *
- * Available variables for single cardinality fields:
- * - elements: Form elements to be rendered.
- *
- * Available variables when there are multiple fields.
- * - table: Table of field items.
- * - description: The description element containing the following properties:
- * - content: The description content of the form element.
- * - attributes: HTML attributes to apply to the description container.
- * - button: "Add another item" button.
- *
- * @see template_preprocess_field_multiple_value_form()
- */
- #}
- {% if multiple %}
- {%
- set classes = [
- 'js-form-item',
- 'form-item'
- ]
- %}
- <div{{ attributes.addClass(classes) }}>
- {{ table }}
- {% if description.content %}
- <div{{ description.attributes.addClass('description') }} >{{ description.content }}</div>
- {% endif %}
- {% if button %}
- <div class="clearfix">{{ button }}</div>
- {% endif %}
- </div>
- {% else %}
- {% for element in elements %}
- {{ element }}
- {% endfor %}
- {% endif %}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.