{% import '_includes/forms' as forms %} {% extends 'feed-me/_layouts' %} {% do view.registerTranslations('feed-me', [ 'Suspend missing users', 'Suspends any users that are missing from the feed.', 'None', ]) %} {% set crumbs = [ { label: craft.feedme.getPluginName|t('feed-me'), url: url('feed-me') }, ] %} {% if feed.id %} {% set crumbs = crumbs|merge([ { label: feed.name|t('feed-me'), url: url('feed-me/feeds/' ~ feed.id) }, ]) %} {% endif %} {% set title = (feed.id) ? feed.name : 'Create a new feed'|t('feed-me') %} {% set noTabs = true %} {% set fullPageForm = true %} {% set buttons %}
{% endset %} {% block actionButton %} {{ buttons }} {% endblock %} {% block content %} {% if feed.id %}{% endif %} {{ forms.textField({ first: true, label: "Name"|t('feed-me'), instructions: "What this feed will be called in the CP."|t('feed-me'), id: 'name', name: 'name', value: feed.name, errors: feed.getErrors('name'), autofocus: true, required: true, }) }} {{ forms.textField({ label: "Feed URL"|t('feed-me'), instructions: "Can be a file on the local file system or from a website url (http://...)."|t('feed-me'), id: 'feedUrl', name: 'feedUrl', value: feed.feedUrl, errors: feed.getErrors('feedUrl'), required: true, }) }} {{ forms.selectField({ label: "Feed Type"|t('feed-me'), instructions: 'Choose what type of feed you’re retrieving.'|t('feed-me'), id: 'feedType', name: 'feedType', options: dataTypes, value: feed.feedType, errors: feed.getErrors('feedType'), required: true, }) }}{{ 'Choose what happens when this feed is run again.'|t('feed-me') }}
{{ forms.checkboxField({ id: 'is-create', name: 'duplicateHandle[]', label: 'Create new elements'|t('feed-me'), instructions: 'Adds new elements if they do not already exist.'|t('feed-me'), value: 'add', checked: not feed.singleton and 'add' in (feed.duplicateHandle ?? ['add']), disabled: feed.singleton, }) }} {{ forms.checkboxField({ id: 'is-update', name: 'duplicateHandle[]', label: 'Update existing elements'|t('feed-me'), instructions: 'Updates elements that match the Unique Identifier (next step).'|t('feed-me'), value: 'update', checked: feed.singleton or 'update' in (feed.duplicateHandle ?? []), disabled: feed.singleton, }) }} {{ forms.checkboxField({ id: 'is-disable-globally', name: 'duplicateHandle[]', label: craft.app.isMultiSite ? 'Disable missing elements globally'|t('feed-me') : 'Disable missing elements'|t('feed-me'), instructions: craft.app.isMultiSite ? 'Disables any elements that are missing from the feed, across all sites.'|t('feed-me') : 'Disables any elements that are missing from the feed.'|t('feed-me'), value: 'disable', checked: not feed.singleton and 'disable' in (feed.duplicateHandle ?? []), disabled: feed.singleton, }) }} {% if craft.app.isMultiSite %} {{ forms.checkboxField({ id: 'is-disable-site', name: 'duplicateHandle[]', label: 'Disable missing elements in the target site'|t('feed-me'), instructions: 'Disables any elements that are missing from the feed, in the feed’s target site only.'|t('feed-me'), value: 'disableForSite', checked: not feed.singleton and 'disableForSite' in (feed.duplicateHandle ?? []), disabled: feed.singleton, }) }} {% endif %} {{ forms.checkboxField({ id: 'is-delete', name: 'duplicateHandle[]', label: 'Delete missing elements'|t('feed-me'), instructions: 'Deletes any elements that are missing from the feed. Be careful.'|t('feed-me'), value: 'delete', checked: not feed.singleton and 'delete' in (feed.duplicateHandle ?? []), disabled: feed.singleton, }) }} {{ forms.checkboxField({ id: 'is-update-search-indexes', name: 'updateSearchIndexes', label: 'Update search indexes'|t('feed-me'), instructions: 'Whether search indexes should be updated.'|t('feed-me'), checked: not feed.singleton and feed.updateSearchIndexes, disabled: feed.singleton, }) }}