{% assets %} {% block stylesheets %} {% endblock %} {% block javascript %} {% endblock %} {% endassets -%} {% assets in 'footer' %} {% block javascript_footer %} {% endblock %} {% endassets -%} {% set name = (name ?? field.name) -%} {% set default_value = (default_value ?? field.default) -%} {% set current_value = (current_value ?? value) -%} {% set has_value = current_value is not null -%} {% set value = has_value ? current_value : default_value -%} {% block field %} {% if not field.isset or value is not null %}
{% block overridable %} {% set field_overridable = field.overridable ?? (field.overrideable ?? true) %} {% if overrideable and (field_overridable or has_value) %} {% include 'forms/override.html.twig' with {'scope': scope, 'name': name, 'field': field} %} {% endif %} {% endblock %} {% block contents %} {% block label %} {% if field.description %} {% set description = field.description|trans_key('GANTRY5_FORM_FIELD', scope, name, 'DESC') %} {{ field.label|trans_key('GANTRY5_FORM_FIELD', scope, name, 'LABEL') }} {% else %} {{ field.label|trans_key('GANTRY5_FORM_FIELD', scope, name, 'LABEL') }} {% endif %} {{ field.validate.required in ['on', 'true', 1] ? '*' }} {% endblock %}
{% block group %} {% block input %} {% block reset_field -%} {% if field.reset_field is not defined or field.reset_field in ['on', 'true', 1] %} {% endif %} {%- endblock %} {% endblock %} {% endblock %}
{% endblock %}
{% endif %} {% endblock %}