You are here

text-format-wrapper.html.twig in Drupal 10

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.
    • disabled: An indicator for whether the associated form element is disabled,

    added by this theme.

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>