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

19 lines
470 B
Twig
Raw Normal View History

{% 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 %}
{% include 'forms/default/fields.html.twig' with {name: field.name, fields: field.fields} %}
{% if field.classes %}
</div>
{% endif %}
{% endif %}
{% endblock %}