简体   繁体   中英

FilesProcessor and viewhelper f:uri.image

I added to a Fluidtemplate cObject a FilesProcessor:

dataProcessing {
  10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
  10.references.fieldName = media
}

in my fluid template i get the correct files object:

0 => TYPO3\CMS\Core\Resource\FileReferenceprototypeobject
1 => TYPO3\CMS\Core\Resource\FileReferenceprototypeobject

This works:

<f:for each="{files}" as="file" iteration="i">
    <img src="{f:uri.image(image: file, width: '967c', height: '967c')}" alt="">
</f:for>

but this throws an exception:

<img src="{f:uri.image(image: files.0, width: '967c', height: '967c')}" alt="">

Does anyone know why? When i debug it with d:debug i get for file the foreach exact the same output like files.0 without foreach.

Thanks!

Your inline notation not working because of you pass null value in notation. because of files.0 output is null

You store image as object. so you can't get this fields value like files.o see below screenshot. 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM