You are here

entityreference-dragdrop-options-list.html.twig in Entity Reference Drag & Drop 8

Same filename and directory in other branches
  1. 2.x templates/entityreference-dragdrop-options-list.html.twig

Theme implementation for an entity reference drag&drop widget option list.

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.
  • wrapper_attributes: HTML attributes to be applied to the list wrapper.
  • attributes: HTML attributes to be applied to the list.

File

templates/entityreference-dragdrop-options-list.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme implementation for an entity reference drag&drop widget option list.
  5. *
  6. * Available variables:
  7. * - items: A list of items. Each item contains:
  8. * - attributes: HTML attributes to be applied to each list item.
  9. * - value: The content of the list element.
  10. * - title: The title of the list.
  11. * - wrapper_attributes: HTML attributes to be applied to the list wrapper.
  12. * - attributes: HTML attributes to be applied to the list.
  13. *
  14. * @see template_preprocess_entityreference_dragdrop_options_list()
  15. */
  16. #}
  17. <div {{ wrapper_attributes.addClass('item-list') }}>
  18. {%- if title is not empty -%}
  19. <h3>{{ title|raw }}</h3>
  20. {%- endif -%}
  21. {% if display_filter %}
  22. {{ filter }}
  23. {% endif %}
  24. <ul {{ attributes }}>
  25. {%- if items -%}
  26. {%- for item in items -%}
  27. <li{{ item.attributes }}>{{ item.value }}</li>
  28. {%- endfor -%}
  29. {% endif %}
  30. </ul>
  31. </div>