diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-78347-AddStdWrapPropertiesToFilesProcessor.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-78347-AddStdWrapPropertiesToFilesProcessor.rst new file mode 100644 index 0000000000000000000000000000000000000000..5cf28d2dea9920dd73db878b6de679ca8de612b7 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-78347-AddStdWrapPropertiesToFilesProcessor.rst @@ -0,0 +1,38 @@ +.. include:: ../../Includes.txt + +========================================================== +Feature: #78347 - Add StdWrap properties to FilesProcessor +========================================================== + +See :issue:`78347` + +Description +=========== + +Add stdWrap properties to FLUIDTEMPLATEs FilesProcessor as it is possible in FilesContentObject, too. +That way you can implement slide-functionality on rootline for file resources. + + +TypoScript dataProcessing example with FilesProcessor +----------------------------------------------------- + +.. code-block:: typoscript + + page.10 = FLUIDTEMPLATE + page.10.dataProcessing { + 10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor + 10 { + references.data = levelmedia: -1, slide + as = myfiles + } + + +Impact +====== + +The FilesProcessor can slide up and down the rootline to collect images for FLUID templates. +One usual feature is to use images attached to pages and use them up and down the page tree +for header images in frontend. + + +.. index:: TypoScript, Frontend diff --git a/typo3/sysext/frontend/Classes/DataProcessing/FilesProcessor.php b/typo3/sysext/frontend/Classes/DataProcessing/FilesProcessor.php index cd7dd1823b174a64478d91f16b814ede09673c45..f705e2677d901a51e03ff40bdd58d04d46e447e6 100644 --- a/typo3/sysext/frontend/Classes/DataProcessing/FilesProcessor.php +++ b/typo3/sysext/frontend/Classes/DataProcessing/FilesProcessor.php @@ -58,16 +58,25 @@ class FilesProcessor implements DataProcessorInterface $fileCollector = GeneralUtility::makeInstance(FileCollector::class); // references / relations - if (!empty($processorConfiguration['references.'])) { - $referenceConfiguration = $processorConfiguration['references.']; - $relationField = $cObj->stdWrapValue('fieldName', $referenceConfiguration); + if ( + (isset($processorConfiguration['references']) && $processorConfiguration['references']) + || (isset($processorConfiguration['references.']) && $processorConfiguration['references.']) + ) { + $referencesUidList = $cObj->stdWrapValue('references', $processorConfiguration); + $referencesUids = GeneralUtility::intExplode(',', $referencesUidList, true); + $fileCollector->addFileReferences($referencesUids); - // If no reference fieldName is set, there's nothing to do - if (!empty($relationField)) { - // Fetch the references of the default element - $relationTable = $cObj->stdWrapValue('table', $referenceConfiguration, $cObj->getCurrentTable()); - if (!empty($relationTable)) { - $fileCollector->addFilesFromRelation($relationTable, $relationField, $cObj->data); + if (!empty($processorConfiguration['references.'])) { + $referenceConfiguration = $processorConfiguration['references.']; + $relationField = $cObj->stdWrapValue('fieldName', $referenceConfiguration); + + // If no reference fieldName is set, there's nothing to do + if (!empty($relationField)) { + // Fetch the references of the default element + $relationTable = $cObj->stdWrapValue('table', $referenceConfiguration, $cObj->getCurrentTable()); + if (!empty($relationTable)) { + $fileCollector->addFilesFromRelation($relationTable, $relationField, $cObj->data); + } } } }