You are here

datetime-wrapper.html.twig in Drupal 10

Theme override of a datetime form wrapper.

@todo Refactor when https://www.drupal.org/node/3010558 is fixed.

File

core/themes/olivero/templates/datetime-wrapper.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override of a datetime form wrapper.
  5. *
  6. * @todo Refactor when https://www.drupal.org/node/3010558 is fixed.
  7. *
  8. * @see template_preprocess_form_element()
  9. */
  10. #}
  11. {%
  12. set title_classes = [
  13. 'form-item__label',
  14. required ? 'js-form-required',
  15. required ? 'form-required',
  16. ]
  17. %}
  18. <div class="form-item form-datetime-wrapper">
  19. {% if title %}
  20. <h4{{ title_attributes.addClass(title_classes) }}>{{ title }}</h4>
  21. {% endif %}
  22. {{ content }}
  23. {% if errors %}
  24. <div class="form-item__error-message">
  25. {{ errors }}
  26. </div>
  27. {% endif %}
  28. {% if description %}
  29. <div{{ description_attributes.addClass('form-item__description') }}>
  30. {{ description }}
  31. </div>
  32. {% endif %}
  33. </div>