image-widget.html.twig

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

Theme override for an image field widget.

Available variables:

  • main_items: Main render elements of the image widget: file name, upload input, upload and remove buttons and hidden inputs.
  • data: Other render elements of the image widget like preview, alt or title.
  • display: A flag indicating whether the display field is visible.
  • attributes: HTML attributes for the containing element.
  • multiple: Whether this widget is the part of a multi-value file widget or not.
  • upload: Whether the file upload input is displayed or not.
  • has_value: true if the widget already contains a file.
  • has_meta: true when at least one of the alt or title inputs is enabled and visible.

See also

template_preprocess_image_widget()

stable_preprocess_image_widget()

claro_preprocess_image_widget()

File

core/themes/claro/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. * - main_items: Main render elements of the image widget:
  8. * file name, upload input, upload and remove buttons and hidden inputs.
  9. * - data: Other render elements of the image widget like preview, alt or title.
  10. * - display: A flag indicating whether the display field is visible.
  11. * - attributes: HTML attributes for the containing element.
  12. * - multiple: Whether this widget is the part of a multi-value file widget or
  13. * not.
  14. * - upload: Whether the file upload input is displayed or not.
  15. * - has_value: true if the widget already contains a file.
  16. * - has_meta: true when at least one of the alt or title inputs is enabled and
  17. * visible.
  18. *
  19. * @see template_preprocess_image_widget()
  20. * @see stable_preprocess_image_widget()
  21. * @see claro_preprocess_image_widget()
  22. */
  23. #}
  24. {% extends '@claro/content-edit/file-managed-file.html.twig' %}
  25. {% set attributes = attributes.addClass('form-managed-file--image') %}

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