You are here

item-list--media-library-add-form-media-list.html.twig in Media Library Theme Reset 8

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.

File

templates/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 %}