簡體   English   中英

FilesProcessor和viewhelper f:uri.image

[英]FilesProcessor and viewhelper f:uri.image

我向Fluidtemplate cObject添加了一個FilesProcessor:

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

在我的流體模板中,我得到了正確的文件對象:

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

這有效:

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

但這會引發異常:

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

有人知道為什么嗎? 當我用d:debug調試時,我得到foreach文件,與沒有filed.0一樣,輸出的文件完全相同。

謝謝!

您的內聯表示法不起作用,因為您在表示法中傳遞了null值。 由於files.0輸出為null

您將圖像存儲為對象。 因此您無法獲得該字段值(例如files.o請參見下面的屏幕截圖。 在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM