[TYPO3-mvc] Determin type of fileCollection

Heiko Kromm | Paints h.kromm at paints.de
Thu May 16 18:13:07 CEST 2013


Hi List, 

I'm trying to use fileCollections within extbase/fluid. 
Is there a way to determin in fluid, which type of fileCollection I have. 
At the moment there are two possible types of fileCollections TYPO3\CMS\Core\Resource\Collection\StaticFileCollection and TYPO3\CMS\Core\Resource\Collection\FolderBasedFileCollection. 
In the StaticFileCollection, the files are TYPO3\CMS\Core\Resource\FileReference objects, in FolderBasedFileCollection the files are TYPO3\CMS\Core\Resource\File objects. 

If I loop through the collection-Items like this: 
<f:for each="{fileCollections}" as="collectionImages"> 
<f:for each="{collectionImages}" as="collectionImage"> 
<f:image src="{collectionImage.uid}" alt="" /><br /> 
</f:for> 
</f:for> 
it will only work for FolderBasedFileCollections,not for StaticFileCollections because the files there are FileReferences. 

Is ther any way to determin the object type of the fileCollection or the type of file? 

Regards 
Heiko 



More information about the TYPO3-project-typo3v4mvc mailing list