{% if not field.validate.ignore %} {% set field_name = (scope ~ field.name)|fieldName %} {% set vertical = field.style == 'vertical' %} {% if not blueprints or (blueprints.schema.type(field.type)['input@'] ?? true) is same as(true) %} {% set toggleable = field.toggleable ?? false %} {% if toggleable %} {% set originalValue = originalValue is defined ? originalValue : value %} {% set toggleableChecked = originalValue is not null and originalValue is not empty %} {% elseif field.overridable %} {% set toggleable = true %} {% set default = form.getDefaultValue(field.name) ?? field.default %} {% set toggleableChecked = value != default %} {% endif %} {% set cookie_name = 'forms-' ~ form.name ~ '-' ~ field.name %} {% set value = value ?? (get_cookie(cookie_name) is not null ? get_cookie(cookie_name) : field.default) %} {% if (field.yaml or field.validate.type == 'yaml') and value is iterable %} {% set value = value|toYaml %} {% endif %} {% else %} {% set toggleable = false %} {% endif %} {# DEPRECATED: Needed by old form fields; remove when backwards compatibility breaks are allowed #} {% set isDisabledToggleable = toggleable and not toggleableChecked %} {% set errors = attribute(form.messages, field.name) %} {% set required = client_side_validation and field.validate.required in ['on', 'true', 1] %} {% set autofocus = (inline_errors == false) and field.autofocus in ['on', 'true', 1] %} {% if inline_errors and errors %} {% set autofocus = true %} {% endif %} {% block field %}
{% block contents %} {% if field.label is not same as(false) and field.display_label is not same as(false) %}
{% if toggleable %} {% include 'forms/default/toggleable.html.twig' with {field_name: field_name, field: field, checked: toggleableChecked} %} {% endif %}
{% endif %}
{% block group %} {% block input %}
{% block prepend %}{% endblock prepend %} {% block append %}{% endblock append %} {% if inline_errors and errors %}

{{ errors|first }}

{% endif %}
{% endblock %} {% endblock %} {% if field.description %}
{% if field.markdown %} {{ field.description|t|markdown(false)|raw }} {% else %} {{ field.description|t|raw }} {% endif %}
{% endif %}
{% endblock %}
{% endblock %} {% endif %}