media-library-item.html.twig

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

Default theme implementation of a media library item.

This is used when displaying selected media items, either in the field widget or in the "Additional selected media" area when adding new media items in the media library modal dialog.

Available variables:

  • attributes: HTML attributes for the containing element.
  • content: The content of the media library item, plus any additional fields or elements surrounding it.

See also

template_preprocess_media_library_item()

2 theme calls to media-library-item.html.twig
AddFormBase::buildSelectedItemElement in core/modules/media_library/src/Form/AddFormBase.php
Returns a render array for a single pre-selected media item.
MediaLibraryWidget::formElement in core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php
Returns the form for a single field widget.

File

core/modules/media_library/templates/media-library-item.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation of a media library item.
  5. *
  6. * This is used when displaying selected media items, either in the field
  7. * widget or in the "Additional selected media" area when adding new
  8. * media items in the media library modal dialog.
  9. *
  10. * Available variables:
  11. * - attributes: HTML attributes for the containing element.
  12. * - content: The content of the media library item, plus any additional
  13. * fields or elements surrounding it.
  14. *
  15. * @see template_preprocess_media_library_item()
  16. *
  17. * @ingroup themeable
  18. */
  19. #}
  20. <div{{ attributes }}>
  21. {{ content }}
  22. </div>

Related topics


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