item-list--media-library-add-form-media-list.html.twig

Same filename in this branch
  1. 9 core/themes/claro/templates/media-library/item-list--media-library-add-form-media-list.html.twig
Same filename in other branches
  1. 8.9.x core/themes/seven/templates/media-library/item-list--media-library-add-form-media-list.html.twig
  2. 8.9.x core/themes/claro/templates/media-library/item-list--media-library-add-form-media-list.html.twig
  3. 10 core/themes/claro/templates/media-library/item-list--media-library-add-form-media-list.html.twig
  4. 11.x core/themes/claro/templates/media-library/item-list--media-library-add-form-media-list.html.twig

Theme override for a list of new, unsaved media items being added in the modal media library dialog.

Available variables:

  • items: A list of items. Each item contains:

    • attributes: HTML attributes to be applied to each list item.
    • value: The content of the list element.
  • title: The title of the list.
  • list_type: The tag for list element ("ul" or "ol").
  • wrapper_attributes: HTML attributes to be applied to the list wrapper.
  • attributes: HTML attributes to be applied to the list.
  • empty: A message to display when there are no items. Allowed value is a string or render array.
  • context: A list of contextual data associated with the list. May contain:
    • list_style: The custom list style.

See also

seven_preprocess_item_list__media_library_add_form_media_list()

template_preprocess_item_list()

File

core/themes/seven/templates/media-library/item-list--media-library-add-form-media-list.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for a list of new, unsaved media items being added in the
  5. * modal media library dialog.
  6. *
  7. * Available variables:
  8. * - items: A list of items. Each item contains:
  9. * - attributes: HTML attributes to be applied to each list item.
  10. * - value: The content of the list element.
  11. * - title: The title of the list.
  12. * - list_type: The tag for list element ("ul" or "ol").
  13. * - wrapper_attributes: HTML attributes to be applied to the list wrapper.
  14. * - attributes: HTML attributes to be applied to the list.
  15. * - empty: A message to display when there are no items. Allowed value is a
  16. * string or render array.
  17. * - context: A list of contextual data associated with the list. May contain:
  18. * - list_style: The custom list style.
  19. *
  20. * @see seven_preprocess_item_list__media_library_add_form_media_list()
  21. * @see template_preprocess_item_list()
  22. */
  23. #}
  24. {% if items -%}
  25. {%- if title is not empty -%}
  26. <h3>{{ title }}</h3>
  27. {%- endif -%}
  28. <{{ list_type }}{{ attributes.addClass('media-library-add-form__added-media') }}>
  29. {%- for item in items -%}
  30. <li{{ item.attributes.addClass('media-library-add-form__media') }}>{{ item.value }}</li>
  31. {%- endfor -%}
  32. </{{ list_type }}>
  33. {%- endif %}

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