Start with default generated template
This commit is contained in:
25
templates/form/form-element-label.html.twig
Normal file
25
templates/form/form-element-label.html.twig
Normal file
@@ -0,0 +1,25 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a form element label.
|
||||
*
|
||||
* Available variables:
|
||||
* - title: The label's text.
|
||||
* - title_display: Elements title_display setting.
|
||||
* - 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()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
title_display == 'after' ? 'option',
|
||||
title_display == 'invisible' ? 'visually-hidden',
|
||||
required ? 'js-form-required',
|
||||
required ? 'form-required',
|
||||
]
|
||||
%}
|
||||
{% if title is not empty or required -%}
|
||||
<label{{ attributes.addClass(classes) }}>{{ title }}</label>
|
||||
{%- endif %}
|
||||
Reference in New Issue
Block a user