Feature #78347
closed
FilesProcessor should support data (especially for level fields)
Added by Andreas Allacher about 8 years ago.
Updated over 3 years ago.
Category:
Fluid Styled Content
Description
Currently the FilesProcessor cannot be used to add references from level-fields because it only retrieves data by fieldName and tableName.
It would be nice if the FilesProcessor also supports levelmedia and other level* data options.
That way the processor could be used on a page FLUIDTEMPLATE to render e.g. a slideshow by using levelmedia.
- Category changed from Fluid to Fluid Styled Content
Today I had the same problem and tried to solve it that way:
20 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
20 {
files.cObject = FILES
files.cObject {
references.data = levelmedia: -1, slide
begin = 0
maxItems = 1
renderObj = TEXT
renderObj.dataWrap = {file:current:originalUid},
}
as = headerimages
}
But that way, you don't have any crop information anymore in your FluidTemplate
Stefan
In FilesContentObject it is already solved with:
$referencesUidList = $this->cObj->stdWrapValue('references', $conf);
$referencesUids = GeneralUtility::intExplode(',', $referencesUidList, true);
$fileCollector->addFileReferences($referencesUids);
- Status changed from New to Under Review
OK...with my patch you can do following now:
# Default PAGE object:
page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 {
references.fieldName = media
references.table = pages
as = headerImages
}
20 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
20 {
references.data = LEVELMEDIA: -1, slide
as = otherImages
}
}
templateName = Default
layoutRootPaths {
10 = EXT:site_package/Resources/Private/Layouts
}
partialRootPaths {
10 = EXT:site_package/Resources/Private/Partials
}
templateRootPaths {
10 = EXT:site_package/Resources/Private/Templates
}
variables {
content < styles.content.get
}
}
{headerImage} will only contain an image, if there is an image assigned in page properties of current site. No slide possible.
{otherImage} will always find an image, as long as you have configures an image on root site.
Would be cool to have that missing Feature/Bugfix in TYPO3 9.5, too.
Stefan
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
This is awesome work, Stefan!
Also available in: Atom
PDF