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/claro/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. errors ? 'has-error',
  17. ]
  18. %}
  19. <div class="form-item form-datetime-wrapper">
  20. {% if title %}
  21. <h4{{ title_attributes.addClass(title_classes) }}>{{ title }}</h4>
  22. {% endif %}
  23. {{ content }}
  24. {% if errors %}
  25. <div class="form-item__error-message">
  26. {{ errors }}
  27. </div>
  28. {% endif %}
  29. {% if description %}
  30. <div{{ description_attributes.addClass('form-item__description') }}>
  31. {{ description }}
  32. </div>
  33. {% endif %}
  34. </div>