container--media-library-widget-selection.html.twig

Same filename in this branch
  1. 10 core/themes/claro/templates/classy/media-library/container--media-library-widget-selection.html.twig
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/templates/classy/media-library/container--media-library-widget-selection.html.twig
  2. 9 core/themes/seven/templates/classy/media-library/container--media-library-widget-selection.html.twig
  3. 9 core/themes/claro/templates/classy/media-library/container--media-library-widget-selection.html.twig
  4. 9 core/themes/bartik/templates/classy/media-library/container--media-library-widget-selection.html.twig
  5. 9 core/themes/classy/templates/media-library/container--media-library-widget-selection.html.twig
  6. 8.9.x core/profiles/demo_umami/themes/umami/templates/classy/media-library/container--media-library-widget-selection.html.twig
  7. 8.9.x core/themes/seven/templates/classy/media-library/container--media-library-widget-selection.html.twig
  8. 8.9.x core/themes/claro/templates/classy/media-library/container--media-library-widget-selection.html.twig
  9. 8.9.x core/themes/bartik/templates/classy/media-library/container--media-library-widget-selection.html.twig
  10. 8.9.x core/themes/classy/templates/media-library/container--media-library-widget-selection.html.twig
  11. 11.x core/profiles/demo_umami/themes/umami/templates/classy/media-library/container--media-library-widget-selection.html.twig
  12. 11.x core/themes/claro/templates/classy/media-library/container--media-library-widget-selection.html.twig

Theme implementation of a wrapper for selected media items.

This is used to wrap around the set of media items that are currently selected in the media library widget (not the modal dialog), which may be used for entity reference fields that target media.

Available variables:

  • attributes: HTML attributes for the containing element.
  • children: The rendered child elements of the container.
  • has_parent: A flag to indicate that the container has one or more parent containers.

See also

template_preprocess_container()

File

core/profiles/demo_umami/themes/umami/templates/classy/media-library/container--media-library-widget-selection.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme implementation of a wrapper for selected media items.
  5. *
  6. * This is used to wrap around the set of media items that are currently
  7. * selected in the media library widget (not the modal dialog), which may
  8. * be used for entity reference fields that target media.
  9. *
  10. * Available variables:
  11. * - attributes: HTML attributes for the containing element.
  12. * - children: The rendered child elements of the container.
  13. * - has_parent: A flag to indicate that the container has one or more parent
  14. containers.
  15. *
  16. * @see template_preprocess_container()
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. {%
  22. set classes = [
  23. has_parent ? 'js-form-wrapper',
  24. has_parent ? 'form-wrapper',
  25. 'media-library-selection',
  26. ]
  27. %}
  28. <div{{ attributes.addClass(classes) }}>{{ children }}</div>

Related topics


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