datetime-wrapper.html.twig

Same filename in this branch
  1. main core/profiles/demo_umami/themes/umami/templates/classy/form/datetime-wrapper.html.twig
  2. main core/themes/olivero/templates/datetime-wrapper.html.twig
  3. main core/themes/stable9/templates/form/datetime-wrapper.html.twig
  4. main core/themes/claro/templates/datetime-wrapper.html.twig
  5. main core/themes/starterkit_theme/templates/form/datetime-wrapper.html.twig
  6. main core/modules/system/templates/datetime-wrapper.html.twig
Same filename and directory in other branches
  1. 10 core/profiles/demo_umami/themes/umami/templates/classy/form/datetime-wrapper.html.twig
  2. 10 core/themes/olivero/templates/datetime-wrapper.html.twig
  3. 10 core/themes/stable9/templates/form/datetime-wrapper.html.twig
  4. 10 core/themes/claro/templates/datetime-wrapper.html.twig
  5. 10 core/themes/starterkit_theme/templates/form/datetime-wrapper.html.twig
  6. 11.x core/profiles/demo_umami/themes/umami/templates/classy/form/datetime-wrapper.html.twig
  7. 11.x core/themes/olivero/templates/datetime-wrapper.html.twig
  8. 11.x core/themes/stable9/templates/form/datetime-wrapper.html.twig
  9. 11.x core/themes/claro/templates/datetime-wrapper.html.twig
  10. 11.x core/themes/starterkit_theme/templates/form/datetime-wrapper.html.twig
  11. 11.x core/modules/system/templates/datetime-wrapper.html.twig
  12. 10 core/modules/system/templates/datetime-wrapper.html.twig
  13. 9 core/profiles/demo_umami/themes/umami/templates/classy/form/datetime-wrapper.html.twig
  14. 9 core/themes/olivero/templates/datetime-wrapper.html.twig
  15. 9 core/themes/stable9/templates/form/datetime-wrapper.html.twig
  16. 9 core/themes/seven/templates/classy/form/datetime-wrapper.html.twig
  17. 9 core/themes/claro/templates/datetime-wrapper.html.twig
  18. 9 core/themes/bartik/templates/classy/form/datetime-wrapper.html.twig
  19. 9 core/themes/stable/templates/form/datetime-wrapper.html.twig
  20. 9 core/themes/starterkit_theme/templates/form/datetime-wrapper.html.twig
  21. 9 core/themes/classy/templates/form/datetime-wrapper.html.twig
  22. 9 core/modules/system/templates/datetime-wrapper.html.twig
  23. 8.9.x core/profiles/demo_umami/themes/umami/templates/classy/form/datetime-wrapper.html.twig
  24. 8.9.x core/themes/seven/templates/classy/form/datetime-wrapper.html.twig
  25. 8.9.x core/themes/claro/templates/datetime-wrapper.html.twig
  26. 8.9.x core/themes/bartik/templates/classy/form/datetime-wrapper.html.twig
  27. 8.9.x core/themes/stable/templates/form/datetime-wrapper.html.twig
  28. 8.9.x core/themes/classy/templates/form/datetime-wrapper.html.twig
  29. 8.9.x core/modules/system/templates/datetime-wrapper.html.twig
  30. 11.x core/themes/admin/templates/form/datetime-wrapper.html.twig

Theme override of a datetime form wrapper.

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

See also

template_preprocess_form_element()

File

core/themes/admin/templates/form/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. {% set show_description_toggle = description_toggle and description %}
  12. {%
  13. set classes = [
  14. 'form-item',
  15. 'form-datetime-wrapper',
  16. show_description_toggle ? 'help-icon__description-container',
  17. ]
  18. %}
  19. {%
  20. set title_classes = [
  21. 'form-item__label',
  22. required ? 'js-form-required',
  23. required ? 'form-required',
  24. errors ? 'has-error',
  25. ]
  26. %}
  27. {%
  28. set description_classes = [
  29. 'form-item__description',
  30. description_display == 'invisible' ? 'visually-hidden',
  31. ]
  32. %}
  33. <div {{ attributes.addClass(classes) }}>
  34. {% if show_description_toggle %}
  35. <div class="help-icon">
  36. {% endif %}
  37. {% if title %}
  38. <h4{{ title_attributes.addClass(title_classes) }}>{{ title }}</h4>
  39. {% endif %}
  40. {% if show_description_toggle %}
  41. {{ attach_library('gin/description_toggle') }}
  42. <button class="help-icon__description-toggle"></button>
  43. </div>
  44. {% endif %}
  45. {{ content }}
  46. {% if errors %}
  47. <div class="form-item__error-message">
  48. {{ errors }}
  49. </div>
  50. {% endif %}
  51. {% if description %}
  52. <div{{ description_attributes.addClass(description_classes) }}>
  53. {{ description }}
  54. </div>
  55. {% endif %}
  56. </div>

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.