file bootstrap-dropdown.html.twig

Default theme implementation to display a Bootstrap Dropdown component.

Available variables:

  • alignment: (optional) The alignment of the dropdown menu.
  • attributes: An array of HTML attributes intended to be added to the main container tag of this template.
  • items: The dropdown menu items.
  • toggle: The toggle element.
Source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a Bootstrap Dropdown component.
  5. *
  6. * Available variables:
  7. * - alignment: (optional) The alignment of the dropdown menu.
  8. * - attributes: An array of HTML attributes intended to be added to the main
  9. * container tag of this template.
  10. * - items: The dropdown menu items.
  11. * - toggle: The toggle element.
  12. *
  13. * @ingroup templates
  14. */
  15. #}
  16. {%
  17. set classes = [
  18. 'btn-group',
  19. alignment ? 'drop' ~ alignment|clean_class : 'dropdown',
  20. ]
  21. %}
  22. <div{{ attributes.addClass(classes) }}>
  23. {{ toggle }}
  24. {{ items }}
  25. </div>

Related topics