You are here

image-widget.html.twig in Drupal 10

Theme override for an image field widget.

Available variables:

  • attributes: HTML attributes for the containing element.
  • data: Render elements of the image widget.

File

core/profiles/demo_umami/themes/umami/templates/classy/content-edit/image-widget.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for an image field widget.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the containing element.
  8. * - data: Render elements of the image widget.
  9. *
  10. * @see template_preprocess_image_widget()
  11. */
  12. #}
  13. <div{{ attributes }}>
  14. {% if data.preview %}
  15. <div class="image-preview">
  16. {{ data.preview }}
  17. </div>
  18. {% endif %}
  19. <div class="image-widget-data">
  20. {# Render widget data without the image preview that was output already. #}
  21. {{ data|without('preview') }}
  22. </div>
  23. </div>