hd77
(Christian Schwahn)
1
Hi,
how do i get the assets title in fluid templates?
i’ve got a NodeType field defined:
files:
type: array<TYPO3\Media\Domain\Model\Asset>
ui:
label: 'PDF Files'
inspector:
group: 'properties'
in fluid i want to render:
< select>
<f:for each="{files}" as=“file” iteration=“itemIterator”>
< option value="{f:uri.resource(resource: file.resource)}">
{file.resource.title}
</ option>
</f:for>
</ select>
aertmann
(Aske Ertmann)
2
did you try {file.label}
?
otherwise try <f:debug>{file}</f:debug>
to see what you have available
hd77
(Christian Schwahn)
3
Oh man thanks a lot!
{file.label} is working fine. Even if i dont have a tittle it gives back the filename.
Anyway, i tried < f:debug> in several ways, it was only giving the Model back like:
< f:debug>{file}< /f:debug>
TYPO3\Flow\Persistence\Doctrine\Proxies_CG_\TYPO3\Media\Domain\Model\Image
or
TYPO3\Flow\Persistence\Doctrine\Proxies_CG_\TYPO3\Media\Domain\Model\Document
<f:debug>{file.resource}</f:debug>
TYPO3\Flow\Persistence\Doctrine\Proxies_CG_\TYPO3\Media\Domain\Model\Resource
so it was hard to find the title property. So you helped me very much!
Thank you!