input--button--split.html.twig in Open Social 8
Same filename and directory in other branches
- 8.9 themes/socialbase/templates/form/input--button--split.html.twig
- 8.2 themes/socialbase/templates/form/input--button--split.html.twig
- 8.3 themes/socialbase/templates/form/input--button--split.html.twig
- 8.4 themes/socialbase/templates/form/input--button--split.html.twig
- 8.5 themes/socialbase/templates/form/input--button--split.html.twig
- 8.6 themes/socialbase/templates/form/input--button--split.html.twig
- 8.7 themes/socialbase/templates/form/input--button--split.html.twig
- 8.8 themes/socialbase/templates/form/input--button--split.html.twig
Theme suggestion for "button__split" input form element.
Available variables:
- attributes: A list of HTML attributes for the input element.
- children: Optional additional rendered elements.
- icon: An icon.
- icon_only: Flag to display only the icon and not the label.
- icon_position: Where an icon should be displayed.
- label: button label.
- prefix: Markup to display before the input element.
- suffix: Markup to display after the input element.
- type: The type of input.
File
themes/socialbase/templates/form/input--button--split.html.twigView source
- {% extends "input--button.html.twig" %}
- {#
- /**
- * @file
- * Theme suggestion for "button__split" input form element.
- *
- * Available variables:
- * - attributes: A list of HTML attributes for the input element.
- * - children: Optional additional rendered elements.
- * - icon: An icon.
- * - icon_only: Flag to display only the icon and not the label.
- * - icon_position: Where an icon should be displayed.
- * - label: button label.
- * - prefix: Markup to display before the input element.
- * - suffix: Markup to display after the input element.
- * - type: The type of input.
- *
- * @see \Drupal\bootstrap\Plugin\Preprocess\InputButton
- * @see \Drupal\bootstrap\Plugin\Preprocess\Input
- * @see template_preprocess_input()
- *
- * @ingroup templates
- */
- #}
- {% spaceless %}
- {% block input %}
- {% if icon_only %}
- <button{{ attributes.addClass(classes, 'icon-only') }}>
- <span class="sr-only">{{ label }}</span>
- {{ icon }}
- </button>
- {% else %}
- {% if icon_position == 'after' %}
- <button{{ attributes.addClass(classes) }}>{{ label }}{{ icon }}</button>{{ children }}
- {% else %}
- <button{{ attributes.addClass(classes) }}>{{ icon }}{{ label }}</button>{{ children }}
- {% endif %}
- {% endif %}
- {%
- set classes = [
- 'btn',
- theme.settings.button_size ? theme.settings.button_size,
- 'dropdown-toggle',
- button_type == 'default' ? 'btn-default',
- button_type == 'flat' ? 'btn-flat',
- button_type == 'primary' ? 'btn-primary',
- button_level == 'raised' ? 'btn-raised',
- ]
- %}
-
- <button{{ split_button_attributes.addClass(classes) }} type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- <span class="caret"></span>
- <span class="sr-only">{{ 'Toggle Dropdown'|t }}</span>
- </button>
- {{ children }}
- {% endblock %}
- {% endspaceless %}