form-element-label--switch.html.twig in Open Social 8
Same filename and directory in other branches
- 8.9 themes/socialbase/templates/form/form-element-label--switch.html.twig
- 8.2 themes/socialbase/templates/form/form-element-label--switch.html.twig
- 8.3 themes/socialbase/templates/form/form-element-label--switch.html.twig
- 8.4 themes/socialbase/templates/form/form-element-label--switch.html.twig
- 8.5 themes/socialbase/templates/form/form-element-label--switch.html.twig
- 8.6 themes/socialbase/templates/form/form-element-label--switch.html.twig
- 8.7 themes/socialbase/templates/form/form-element-label--switch.html.twig
- 8.8 themes/socialbase/templates/form/form-element-label--switch.html.twig
Default theme implementation for a form element label.
Available variables:
- element: an input element.
- title: The label's text.
- title_display: Elements title_display setting.
- description: element description.
- required: An indicator for whether the associated form element is required.
- attributes: A list of HTML attributes for the label.
See also
File
themes/socialbase/templates/form/form-element-label--switch.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation for a form element label.
- *
- * Available variables:
- * - element: an input element.
- * - title: The label's text.
- * - title_display: Elements title_display setting.
- * - description: element description.
- * - required: An indicator for whether the associated form element is required.
- * - attributes: A list of HTML attributes for the label.
- *
- * @see template_preprocess_form_element_label()
- *
- * @ingroup templates
- */
- #}
-
-
- {%- if title is not empty -%}
- <div class="switch__label">
- {{ title }}
- {%- if required -%}
- <span class="form-required">*</span>
- {%- endif -%}
- </div>
- <div class="switch__options">
- {%- trans -%} Off {%- endtrans -%}
- {{ element }}
- <span class="lever"></span>
- {%- trans -%} On {%- endtrans -%}
- {{ children }}
- </div>
-
- {%- endif -%}