datetime-wrapper.html.twig 852 Bytes
Newer Older
1 2 3
{#
/**
 * @file
4
 * Theme override of a datetime form wrapper.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 *
 * Available variables:
 * - content: The form element to be output, usually a datelist, or datetime.
 * - title: The title of the form element.
 * - title_attributes: HTML attributes for the title wrapper.
 * - description: Description text for the form element.
 * - required: An indicator for whether the associated form element is required.
 *
 * @see template_preprocess_datetime_wrapper()
 */
#}
{%
  set title_classes = [
    'label',
    required ? 'form-required',
  ]
%}
{% if title %}
  <h4{{ title_attributes.addClass(title_classes) }}>{{ title }}</h4>
{% endif %}
{{ content }}
26
{% if errors %}
27
  <div class="form-item--error-message">
28 29 30
    <strong>{{ errors }}</strong>
  </div>
{% endif %}
31 32 33
{% if description %}
  <div class="description">{{ description }}</div>
{% endif %}