webseite-grav/plugins/form/templates/forms/fields/conditional/conditional.html.twig

21 lines
516 B
Twig
Raw Permalink Normal View History

2021-04-30 11:23:26 +02:00
{% extends "forms/field.html.twig" %}
{% block field %}
{% set value = evaluate(field.condition) %}
{% set value = value == 'true' ? 1 : value %}
{% set value = value == 'false' ? 0 : value %}
{% if value %}
{% if field.classes %}
<div class="{{ field.classes }}">
{% endif %}
{% if field.fields %}
{% include 'forms/default/fields.html.twig' with {name: field.name, fields: field.fields} %}
{% endif %}
{% if field.classes %}
</div>
{% endif %}
{% endif %}
{% endblock %}