media-library-item.html.twig in Drupal 10
Same filename in this branch
- 10 core/modules/media_library/templates/media-library-item.html.twig
- 10 core/themes/starterkit_theme/templates/media-library/media-library-item.html.twig
- 10 core/themes/classy/templates/media-library/media-library-item.html.twig
- 10 core/themes/stable9/templates/media-library/media-library-item.html.twig
- 10 core/themes/stable/templates/media-library/media-library-item.html.twig
- 10 core/themes/claro/templates/classy/media-library/media-library-item.html.twig
- 10 core/themes/seven/templates/classy/media-library/media-library-item.html.twig
- 10 core/themes/bartik/templates/classy/media-library/media-library-item.html.twig
- 10 core/profiles/demo_umami/themes/umami/templates/classy/media-library/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
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/profiles/demo_umami/themes/umami/templates/classy/media-library/media-library-item.html.twigView source
- {#
- /**
- * @file
- * 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 template_preprocess_media_library_item()
- *
- * @ingroup themeable
- */
- #}
- {%
- set classes = [
- 'media-library-item',
- 'media-library-item--grid',
- ]
- %}
- <div{{ attributes.addClass(classes) }}>
- {{ content }}
- </div>