diff --git a/src/elements/ExportElement.php b/src/elements/ExportElement.php index 8e4b7d2..7db15dd 100644 --- a/src/elements/ExportElement.php +++ b/src/elements/ExportElement.php @@ -11,6 +11,7 @@ use craft\helpers\Json; use studioespresso\exporter\elements\db\ExportElementQuery; use studioespresso\exporter\Exporter; +use studioespresso\exporter\helpers\FieldTypeHelper; use studioespresso\exporter\records\ExportRecord; class ExportElement extends Element @@ -235,13 +236,11 @@ public function getElementQuery(): ElementQuery public function getSupportedFields(Element $element): array { - $supportedFields = Exporter::getInstance()->fields->getAvailableFieldTypes(); + //$supportedFields = Exporter::getInstance()->fields->getAvailableFieldTypes(); $elementFields = $element->fieldLayout->getCustomFields(); return array_filter($elementFields, function ($field) { - // TODO How to handle unsupported fields here? return true; - }); } diff --git a/src/templates/sprig/element/step_2.twig b/src/templates/sprig/element/step_2.twig index fe5494f..afca5c7 100644 --- a/src/templates/sprig/element/step_2.twig +++ b/src/templates/sprig/element/step_2.twig @@ -53,60 +53,85 @@

{{ "Which custom fields do you want to include in this export?"|t('exporter') }}

- {% set availableFields = export.getSupportedFields(element) %} - {% for field in availableFields %} + {% set allFields = export.getSupportedFields(element) %} + {% set showNotSupportedNotice = false %} + {% for field in allFields %} {% set parser = craft.exporter.getFieldParser(field) %} - {% set fieldSettings = false %} - {% if fields|length and attribute(fields, field.handle) %} - {% set fieldSettings = attribute(fields, field.handle) %} - {% endif %} -
-
- - - + {% if not parser %} + {# Parser not found #} + {% set showNotSupportedNotice = true %} +
+
+ + +
-
- {% if parser and parser.getOptionType()|length %} -