{% import '_includes/forms' as forms %} {% import 'feed-me/_macros' as feedMeMacro %} {% set fields = [ { name: 'Source', handle: 'sourceUrl', instructions: 'The source URL' | t('redirect'), required: true, default: { type: 'text', }, }, { name: 'Destination', handle: 'destinationUrl', instructions: 'The destination URL' | t('redirect'), required: true, default: { type: 'text', }, }, { name: 'Response Code', handle: 'statusCode', instructions: 'Redirect status code: 301 or 302' | t('redirect'), default: { type: 'select', options: [ { label: '301', value: '301' }, { label: '302', value: '302' }, ], }, }, { name: 'Redirect ID', handle: 'id', instructions: 'Warning: This should only be used for an existing Redirect ID.' | t('redirect'), type: 'text', }, ] %}

{{ 'Redirect Fields' | t('redirect') }}

{% for field in fields %} {% set template = field.type ?? 'default' %} {% set variables = field | merge({ feed: feed, feedData: feedData, attribute: true }) %} {% include 'feed-me/_includes/fields/' ~ template ignore missing with variables only %} {% endfor %}
{{ 'Field' | t('feed-me') }} {{ 'Feed Element' | t('feed-me') }} {{ 'Default Value' | t('feed-me') }}

{{ "Set a unique identifier to match against existing elements" | t('feed-me') }}

{{ "Select the fields you want to use to check for existing elements. When selected, Feed Me will look for existing elements that match the fields provided below and either update, or skip depending on your choice of Import Strategy." | t('feed-me') }}

{% for field in fields if field and craft.feedme.fieldCanBeUniqueId(field) %} {{ forms.checkboxField({ name: 'fieldUnique[' ~ field.handle ~ ']', label: field.name, checked: feed.fieldUnique[field.handle] ?? '', }) }} {% endfor %}