{% import '_includes/forms' as forms %} {% set nameLabel = nameLabel ?? name ?? null %} {% set handle = handle ?? null %} {% set instructions = instructions ?? null %} {% set instructionsHandle = instructionsHandle ?? handle ?? null %} {% set default = default ?? null %} {% set required = required ?? null %} {% set attribute = attribute ?? null %} {% set field = field ?? null %} {% set fieldClass = fieldClass ?? null %} {% set path = path ?? [handle] %} {% set namespacePath = path|join('][') %} {% set nodePath = path|join('.') ~ '.node' %} {% set namespace = 'fieldMapping[' ~ namespacePath ~ ']' %} {% set value = hash_get(feed.fieldMapping, nodePath) %}
{% if attribute and instructions %}

{{ instructions|raw }}

{% endif %} {% if fieldClass and instructionsHandle %}
{{ instructionsHandle }}
{% endif %}
{% set nodeOptions = [{ label: 'Don’t import' | t('feed-me'), value: 'noimport' }] %} {% for nodeKey, nodeValue in feed.getFeedNodes().data %} {% if nodeKey %} {% set nodeOptions = nodeOptions | merge([{ label: nodeValue, value: nodeKey }]) %} {% endif %} {% endfor %} {% namespace namespace %} {{ forms.selectField({ name: 'node', value: value, options: nodeOptions, class: 'selectize fullwidth', }) }} {% endnamespace %}