{% import '_includes/forms' as forms %} {% extends 'feed-me/_layouts' %} {% set crumbs = [ { label: craft.feedme.getPluginName|t('feed-me'), url: url('feed-me') }, { label: feed.name|t('feed-me'), url: url('feed-me/feeds/' ~ feed.id) }, { label: 'Element'|t('feed-me'), url: url('feed-me/feeds/element/' ~ feed.id) }, ] %} {% set title = feed.name %} {% set title = (feed.id) ? feed.name : 'Create a new feed'|t('feed-me') %} {% set noTabs = true %} {% set fullPageForm = true %} {% set buttons %} {% if primaryElements.success %}
{% endif %} {% endset %} {% block actionButton %} {{ buttons }} {% endblock %} {% block content %} {% if primaryElements.success %} {% if feed.id %} {% endif %} {{ forms.selectField({ label: "Primary Element"|t('feed-me'), instructions: "The primary element is the repeatable element that contains the data you want to import."|t('feed-me'), id: 'primaryElement', name: 'primaryElement', value: feed.primaryElement, options: primaryElements.data, errors: feed.getErrors('primaryElement'), }) }} {% set parsedFeedData = [ { label: "No Pagination URL"|t('feed-me'), value: '' }, ] %} {% for key, data in feedMappingData.data %} {% if data is iterable %} {% set snippet = '' %} {% else %} {% set snippet = data|length > 30 ? data[0:30] ~ '...' : data %} {% endif %} {% set parsedFeedData = parsedFeedData|merge([{ label: '<' ~ key ~ '> eg: ' ~ snippet, value: key }]) %} {% endfor %} {{ forms.selectField({ label: "Pagination URL"|t('feed-me'), instructions: 'If your feed is paginated, select the next page’s URL.'|t('feed-me'), id: 'paginationNode', name: 'paginationNode', value: feed.paginationNode, options: parsedFeedData, errors: feed.getErrors('paginationNode'), }) }} {% else %}{{ 'Feed Me is unable to find, or parse your provided data. This usually means your URL cannot be reached from your Craft site, or your {feedType} is invalid. Refer to the specific error below, check the logs, and double-check your settings.'|t('feed-me', { feedType: feed.feedType|upper }) }}
{% if primaryElements.error %} {% endif %}