templates/includes/utils/button-group.html.twig line 1

Open in your IDE?
  1. {% set styleModifier = styleModifier | default('mt-4') %}
  2. {% if buttons|default([])|length > 0%}
  3.     <div class="{{ styleModifier }}">
  4.         <div class="d-sm-flex">
  5.             {%  for button in buttons %}
  6.                 {% set event = button.event ?? null %}
  7.                 <div class="mb-3 mb-sm-0 me-sm-3">
  8.                     <a href="{{ button.href }}" class="btn {{ button.styleModifier|default('') }}"
  9.                         {% if event == 'click_contact_cta' %}
  10.                             data-event-tracking-event="{{ event }}"
  11.                             data-event-tracking-click_text="{{ button.caption }}"
  12.                             data-event-tracking-click_url="{{ button.href }}"
  13.                         {% endif %}
  14.                        >
  15.                         {% if button.icon is defined and button.iconPosition is defined and button.iconPosition == 'before' %}
  16.                             <span class="btn__icon"><span class="icon icon-{{ button.icon }}" aria-hidden="true"></span></span>
  17.                         {% endif %}
  18.                         <span class="btn__text">{{ button.caption|default('') }}</span>
  19.                         {% if button.icon is defined and (button.iconPosition is not defined or (button.iconPosition is defined and button.iconPosition == 'after')) %}
  20.                             <span class="btn__icon"><span class="icon icon-{{ button.icon }}" aria-hidden="true"></span></span>
  21.                         {% endif %}
  22.                     </a>
  23.                 </div>
  24.             {% endfor %}
  25.         </div>
  26.     </div>
  27. {% endif %}