annotate core/modules/system/templates/field-multiple-value-form.html.twig @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents af1871eacc83
children
rev   line source
Chris@0 1 {#
Chris@0 2 /**
Chris@0 3 * @file
Chris@0 4 * Default theme implementation for an individual form element.
Chris@0 5 *
Chris@0 6 * Available variables for all fields:
Chris@0 7 * - multiple: Whether there are multiple instances of the field.
Chris@0 8 *
Chris@0 9 * Available variables for single cardinality fields:
Chris@0 10 * - elements: Form elements to be rendered.
Chris@0 11 *
Chris@0 12 * Available variables when there are multiple fields.
Chris@0 13 * - table: Table of field items.
Chris@0 14 * - description: The description element containing the following properties:
Chris@0 15 * - content: The description content of the form element.
Chris@0 16 * - attributes: HTML attributes to apply to the description container.
Chris@0 17 * - button: "Add another item" button.
Chris@0 18 *
Chris@0 19 * @see template_preprocess_field_multiple_value_form()
Chris@0 20 *
Chris@0 21 * @ingroup themeable
Chris@0 22 */
Chris@0 23 #}
Chris@0 24 {% if multiple %}
Chris@18 25 {%
Chris@18 26 set classes = [
Chris@18 27 'js-form-item',
Chris@18 28 'form-item'
Chris@18 29 ]
Chris@18 30 %}
Chris@18 31 <div{{ attributes.addClass(classes) }}>
Chris@0 32 {{ table }}
Chris@0 33 {% if description.content %}
Chris@0 34 <div{{ description.attributes.addClass('description') }} >{{ description.content }}</div>
Chris@0 35 {% endif %}
Chris@0 36 {% if button %}
Chris@0 37 <div class="clearfix">{{ button }}</div>
Chris@0 38 {% endif %}
Chris@0 39 </div>
Chris@0 40 {% else %}
Chris@0 41 {% for element in elements %}
Chris@0 42 {{ element }}
Chris@0 43 {% endfor %}
Chris@0 44 {% endif %}