You are here

views-jump-menu.html.twig in Views Jump Menu 8

Default theme implementation for a view template to display a jump menu.

Available variables:

  • attributes: HTML attributes for the container.
  • rows: A list of rows for this jump menu.
    • attributes: The row's HTML attributes.
    • content: The row's contents.
  • title: The title of this group of rows. May be empty.
  • select: @todo.
    • type: Starting tag will be either a ul or ol.
    • attributes: HTML attributes for the list element.

File

templates/views-jump-menu.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a view template to display a jump menu.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the container.
  8. * - rows: A list of rows for this jump menu.
  9. * - attributes: The row's HTML attributes.
  10. * - content: The row's contents.
  11. * - title: The title of this group of rows. May be empty.
  12. * - select: @todo.
  13. * - type: Starting tag will be either a ul or ol.
  14. * - attributes: HTML attributes for the list element.
  15. *
  16. * @see template_preprocess_views_view_list()
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. {{ attach_library('views_jump_menu/views-jump-menu') }}
  22. {% if attributes -%}
  23. <div{{ attributes }}>
  24. {% endif %}
  25. {% if title %}<h3>{{ title }}</h3>{% endif %}
  26. <select{{ select.attributes }}{% if select.select_label %} aria-label="{{ select.select_label }}"{% endif %}>
  27. <option>{{ select.select_text }}</option>
  28. {% for option in select.options %}
  29. <option data-url="{{ option.url }}">{{ option.label }}</option>
  30. {% endfor %}
  31. </select>
  32. {% if attributes -%}
  33. </div>
  34. {% endif %}