You are here

image-widget.html.twig in Drupal 9

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/themes/seven/templates/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. {{ attach_library('seven/classy.image-widget') }}
  14. <div{{ attributes }}>
  15. {% if data.preview %}
  16. <div class="image-preview">
  17. {{ data.preview }}
  18. </div>
  19. {% endif %}
  20. <div class="image-widget-data">
  21. {# Render widget data without the image preview that was output already. #}
  22. {{ data|without('preview') }}
  23. </div>
  24. </div>