{% set displayInline = not category.enableDescription and not category.singleOption %} {% if displayInline %} {% for option in category.options %} {#{% if option.enableDescription %} {% set displayInline = false %} {% endif %}#} {% if option.displayChildrenInForm %} {% for subcategory in option.subcategories %} {% if subcategory.displayInForm %} {% set displayInline = false %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% endif %} {% if category.displayInForm %} {% set categoryDepth = parentDepth is defined ? parentDepth + 1 : 0 %}
{% for key, option in category.options %} {% set displayOption = false %} {% set curr_description = '' %} {% set curr_index = 0 %} {% for optionValue in element.optionValues %} {% if optionValue.optionId == option.id %} {% set displayOption = true %} {% set curr_description = optionValue.description %} {% set curr_index = optionValue.index %} {% endif %} {% endfor %}
{% set iconClass = (option.icon is defined and option.icon) ? option.icon : 'icon-angle-right' %} {% set iconColorId = '' %} {% if iconClass %} {% endif %} {{ option.name }} {% if category.enableDescription or option.enableDescription %}
{% endif %}
{% if option.displayChildrenInForm %}
{% for subkey, subcategory in option.subcategories %} {% include 'element-form/form-partials/taxonomy-field.html.twig' with {'category': subcategory, 'parentDepth': categoryDepth } %} {% endfor %}
{% endif %}
{% endfor %}
{% endif %}