eleven-8.x-1.0-beta5/eleven/templates/component/form/form-element-label.html.twig
eleven/templates/component/form/form-element-label.html.twig
{# We want to be able to identity some of the labels so we can change that markup and yank in some icons etc first lets grap the label for id and use that as a identifier so we can add a span for an icon inside the label the wrapper is defined over in form-element.html.twig remember to set it to inline etc #} {% if element['#title'].getUntranslatedString() %} {% set element_name = element['#title'].getUntranslatedString()|clean_class %} {% elseif element['#title'] %} {% set element_name = element['#title']|render %} {% else %} {% set element_name = '' %} {% endif %} {# '_t-elementname--' ~ element_name|clean_class, #} {% set classes = [ title_display == 'invisible' ? 'visually-hidden', required ? 'js-form-required', required ? 'is-required', ] %} {% if title_display == 'invisible' %} <label{{ attributes.addClass(classes).removeClass('visually-hidden') }}> <span class="visually-hidden">{{ title }}</span> </label> {% else %} <label{{ attributes.addClass(classes) }}> {{ title }} </label> {%- endif %}