TYPO3 11.5.33
Task I want to display every category title of a pdf file in a comma separated list in a table column.
I have the content element of CType = uploads and inside I have a sys_file_collection for a folder with pdf files.
I iterate over the {files} array to create a table with columns for example a preview icon, file title, file size and the categories, which were assigned to the file.
<f:for each="{files}" as="file" iteration="fileIterator">
<!-- table code -->
</f:for>
For example:
Image | Title | Category | Filesize
preview pic PDF Title cat1, cat2 3 MB
preview pic PDF Title2 cat3 5 MB
Everything is working except the output of the categories.
If I debug the {file} array I get the following information:
and inside metaDataAspect there are a lot of properties.
There is categories but this has only an integer value, for the number of categories which are selected for that file.
In the Slack channel I was told a dataProcessor is best suited for this use case and was recommended this https://docs.typo3.org/m/typo3/reference-typoscript/11.5/en-us/ContentObjects/Fluidtemplate/DataProcessing/DatabaseQueryProcessor.html
After spending some time on it I have no idea how to get this working.
I also found this WIP task https://forge.typo3.org/issues/82010 | https://review.typo3.org/c/Packages/TYPO3.CMS/+/62123 but it's still not finished and I'm also not sure if that would work with files.
Is there really no out-of-the-box solution for this problem?
Had someone a similar problem already and can help with a solution or is there an existing vhs viewhelper for this purpose?


The output of the
uploadsCE (content Element) is configured in your typoscript attt_content.uploads. There you can find theFilesProcessorwhich provides your list of file data for the FLUID.As you noticed the
categoryfield is just added as is without resolving the relation.You can/ must add another processor (a
databaseQueryProcessor) for resolving these relation:In the manual you can find an example for a
customCategoryProcessorwhich handles exactly your problem. The needed PHP is given in the 'TYPO3 explained'-manual