text-format-wrapper.html.twig

Same filename in this branch
  1. 11.x core/profiles/demo_umami/themes/umami/templates/classy/content-edit/text-format-wrapper.html.twig
  2. 11.x core/themes/olivero/templates/text-format-wrapper.html.twig
  3. 11.x core/themes/stable9/templates/content-edit/text-format-wrapper.html.twig
  4. 11.x core/themes/starterkit_theme/templates/content-edit/text-format-wrapper.html.twig
  5. 11.x core/modules/filter/templates/text-format-wrapper.html.twig
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/templates/classy/content-edit/text-format-wrapper.html.twig
  2. 9 core/themes/olivero/templates/text-format-wrapper.html.twig
  3. 9 core/themes/stable9/templates/content-edit/text-format-wrapper.html.twig
  4. 9 core/themes/seven/templates/classy/content-edit/text-format-wrapper.html.twig
  5. 9 core/themes/claro/templates/text-format-wrapper.html.twig
  6. 9 core/themes/bartik/templates/classy/content-edit/text-format-wrapper.html.twig
  7. 9 core/themes/stable/templates/content-edit/text-format-wrapper.html.twig
  8. 9 core/themes/starterkit_theme/templates/content-edit/text-format-wrapper.html.twig
  9. 9 core/themes/classy/templates/content-edit/text-format-wrapper.html.twig
  10. 9 core/modules/filter/templates/text-format-wrapper.html.twig
  11. 8.9.x core/profiles/demo_umami/themes/umami/templates/classy/content-edit/text-format-wrapper.html.twig
  12. 8.9.x core/themes/seven/templates/classy/content-edit/text-format-wrapper.html.twig
  13. 8.9.x core/themes/claro/templates/text-format-wrapper.html.twig
  14. 8.9.x core/themes/bartik/templates/classy/content-edit/text-format-wrapper.html.twig
  15. 8.9.x core/themes/stable/templates/content-edit/text-format-wrapper.html.twig
  16. 8.9.x core/themes/classy/templates/content-edit/text-format-wrapper.html.twig
  17. 8.9.x core/modules/filter/templates/text-format-wrapper.html.twig
  18. 10 core/profiles/demo_umami/themes/umami/templates/classy/content-edit/text-format-wrapper.html.twig
  19. 10 core/themes/olivero/templates/text-format-wrapper.html.twig
  20. 10 core/themes/stable9/templates/content-edit/text-format-wrapper.html.twig
  21. 10 core/themes/claro/templates/text-format-wrapper.html.twig
  22. 10 core/themes/starterkit_theme/templates/content-edit/text-format-wrapper.html.twig
  23. 10 core/modules/filter/templates/text-format-wrapper.html.twig

Theme override for a text format-enabled form element.

@todo Remove when https://www.drupal.org/node/3016346 and https://www.drupal.org/node/3016343 are fixed.

Available variables:

  • children: Text format element children.
  • description: Text format element description.
  • attributes: HTML attributes for the containing element.
  • aria_description: Flag for whether or not an ARIA description has been added to the description container.
  • description_attributes: attributes for the description.

See also

https://www.drupal.org/node/3016343

template_preprocess_text_format_wrapper()

File

core/themes/claro/templates/text-format-wrapper.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for a text format-enabled form element.
  5. *
  6. * @todo Remove when https://www.drupal.org/node/3016346 and
  7. * https://www.drupal.org/node/3016343 are fixed.
  8. *
  9. * Available variables:
  10. * - children: Text format element children.
  11. * - description: Text format element description.
  12. * - attributes: HTML attributes for the containing element.
  13. * - aria_description: Flag for whether or not an ARIA description has been
  14. * added to the description container.
  15. * - description_attributes: attributes for the description.
  16. * @see https://www.drupal.org/node/3016343
  17. * - disabled: An indicator for whether the associated form element is disabled,
  18. * added by this theme.
  19. * @see https://www.drupal.org/node/3016346
  20. *
  21. * @see template_preprocess_text_format_wrapper()
  22. */
  23. #}
  24. {%
  25. set classes = [
  26. 'js-form-item',
  27. 'form-item',
  28. ]
  29. %}
  30. <div{{ attributes.addClass(classes) }}>
  31. {{ children }}
  32. {% if description %}
  33. {%
  34. set description_classes = [
  35. aria_description ? 'form-item__description',
  36. disabled ? 'is-disabled',
  37. ]
  38. %}
  39. <div{{ description_attributes.addClass(description_classes) }}>{{ description }}</div>
  40. {% endif %}
  41. </div>

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