You are here

bootstrap-dropdown.html.twig in Open Social 8.3

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.

File

themes/socialbase/templates/form/bootstrap-dropdown.html.twig
View 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. 'dropdown',
  20. alignment == 'up' ? 'dropup',
  21. alignment == 'right' ? 'btn-group--primary',
  22. btn_context == 'operations' ? 'btn-group--operations',
  23. ]
  24. %}
  25. <div{{ attributes.addClass(classes) }}>
  26. {{ toggle }}
  27. {{ items }}
  28. </div>