Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

image-widget.html.twig

Same filename in this branch
  1. 11.1.x core/profiles/demo_umami/themes/umami/templates/classy/content-edit/image-widget.html.twig
  2. 11.1.x core/themes/starterkit_theme/templates/content-edit/image-widget.html.twig
  3. 11.1.x core/themes/claro/templates/content-edit/image-widget.html.twig
  4. 11.1.x core/modules/image/templates/image-widget.html.twig

Theme override for an image field widget.

Available variables:

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

See also

template_preprocess_image_widget()

File

core/themes/stable9/templates/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. {{ data.preview }}
  15. {# Render widget data without the image preview that was output already. #}
  16. {{ data|without('preview') }}
  17. </div>

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal