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 @@
{{ parser.getOptionDescription() }}
+ {% else %} + {# We have a parser, so the field is supported #} + {% set fieldSettings = false %} + {% if fields|length and attribute(fields, field.handle) %} + {% set fieldSettings = attribute(fields, field.handle) %} + {% endif %} +{{ parser.getOptionDescription() }}
+{{ "This element contains fields that can not be exported"|t('exporter') }}
+