{# ------------------------ #} {# Available Variables #} {# ------------------------ #} {# Attributes: #} {# type, name, handle, instructions, attribute, default, feed, feedData #} {# ------------------------ #} {# Fields: #} {# name, handle, instructions, feed, feedData, field, fieldClass #} {# ------------------------ #} {% import 'feed-me/_macros' as feedMeMacro %} {% import '_includes/forms' as forms %} {# Special case when inside another complex field (Matrix) #} {% if parentPath is defined %} {% set prefixPath = parentPath %} {% else %} {% set prefixPath = [handle] %} {% endif %} {% set classes = ['complex-field'] %}
{% namespace 'fieldMapping[' ~ prefixPath | join('][') ~ ']' %} {% endnamespace %}
{% for subField in field.getFields() %} {% set nameLabel = subField.label %} {% set instructionsHandle = handle ~ '[' ~ subField.handle ~ ']' %} {% set parentPath = prefixPath | merge ([ 'fields', subField.handle ]) %} {% set fieldClass = craft.feedme.fields.getRegisteredField(className(subField)) %} {% set template = fieldClass.getMappingTemplate() %} {% include template ignore missing with { field: subField, handle: subField.handle, path: parentPath, } %} {% endfor %}