entityreference-dragdrop-options-list.html.twig in Entity Reference Drag & Drop 2.x
Same filename and directory in other branches
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.
1 theme call to entityreference-dragdrop-options-list.html.twig
- EntityReferenceDragDropWidget::optionsToRenderableArray in src/
Plugin/ Field/ FieldWidget/ EntityReferenceDragDropWidget.php - Converts list of options to renderable array.
File
templates/entityreference-dragdrop-options-list.html.twigView source
- {#
- /**
- * @file
- * 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.
- *
- * @see template_preprocess_entityreference_dragdrop_options_list()
- */
- #}
- <div {{ wrapper_attributes.addClass('item-list') }}>
- {%- if title is not empty -%}
- <h3>{{ title|raw }}</h3>
- {%- endif -%}
- {% if display_filter %}
- {{ filter }}
- {% endif %}
- <ul {{ attributes }}>
- {%- if items -%}
- {%- for item in items -%}
- <li{{ item.attributes }}>{{ item.value }}</li>
- {%- endfor -%}
- {% endif %}
- </ul>
- </div>