{% extends "forms/field.html.twig" %} {% set value = (value is null ? field.default : value) %} {% set name = field.name %} {% set btnLabel = field.btnLabel is defined ? field.btnLabel : "PLUGIN_ADMIN.ADD_ITEM" %} {% set btnSortLabel = field.btnSortLabel is defined ? field.btnSortLabel : "PLUGIN_ADMIN.SORT_BY" %} {% set fieldControls = field.controls|default('bottom') %} {% block contents %}
{% if field.toggleable %} {% endif %} {% if field.help %} {{ field.label|tu }} {% else %} {{ field.label|tu }} {% endif %} {{ field.validate.required in ['on', 'true', 1] ? '*' }}
{% if fieldControls in ['top', 'both'] %}
{% if field.sortby %} {% endif %}
{% endif %} {% if fieldControls in ['bottom', 'both'] %}
{% if collapsible %} {% endif %} {% if field.sortby %} {% endif %}
{% endif %} {%- set itemName = name ? name ~ '.*' : '*' -%}
{% if field.sort is not same as(false) %}
{% endif %} {%- if field.fields -%} {%- for childName, child in field.fields -%} {%- if childName == 'value' -%} {%- set childKey = '' -%} {%- set childName = itemName -%} {%- elseif childName starts with '.' -%} {%- set childKey = childName|trim('.') -%} {%- set childName = itemName ~ childName -%} {%- else %} {%- set childKey = childName -%} {%- set childName = childName|replace({'*': key}) -%} {%- endif %} {%- set child = child|merge({ name: childName }) -%} {%- if child.type == 'key' -%} {%- include 'forms/fields/key/key.html.twig' with { field: child, value: null } -%} {%- elseif child.key == true -%} {%- include [ "forms/fields/#{child.type}/#{child.type}.html.twig", 'forms/fields/key/key.html.twig' ] with { field: child, value: null } -%} {%- elseif child.type -%} {%- include [ "forms/fields/#{child.type}/#{child.type}.html.twig", 'forms/fields/text/text.html.twig' ] with { field: child, value: null } -%} {%- endif -%} {%- endfor %}
{% if collapsible %}
{% endif %}
{%- endif -%} {%- endfilter -%}">
{% endblock %}