You are here

views-bootstrap-dropdown.html.twig in Views Bootstrap 8.3

{#
  Render a view containing a list of rows as a drop-down.
  @see http://getbootstrap.com/javascript/#dropdowns
#}
<div id="{{ id }}" {{ attributes.addClass(classes) }}>
  <button {{ button.attributes }} type="button" id="{{ id }}-dropdown" data-toggle="dropdown">
    {{ button.text }}
    <span class="caret"></span>
  </button>
  <ul{{ list.attributes }} role="menu" aria-labelledby="{{ id }}-dropdown">
  {% for key, row in rows %}
    <li{{ row.attributes }}>{{- row.content|render|striptags('<a><img>')|trim|raw -}}</li>
  {% endfor %}
  </ul>
</div>

File

templates/views-bootstrap-dropdown.html.twig
View source
  1. {#
  2. Render a view containing a list of rows as a drop-down.
  3. @see http://getbootstrap.com/javascript/#dropdowns
  4. #}
  5. <div id="{{ id }}" {{ attributes.addClass(classes) }}>
  6. <button {{ button.attributes }} type="button" id="{{ id }}-dropdown" data-toggle="dropdown">
  7. {{ button.text }}
  8. <span class="caret"></span>
  9. </button>
  10. <ul{{ list.attributes }} role="menu" aria-labelledby="{{ id }}-dropdown">
  11. {% for key, row in rows %}
  12. <li{{ row.attributes }}>{{- row.content|render|striptags('<a><img>')|trim|raw -}}</li>
  13. {% endfor %}
  14. </ul>
  15. </div>