TYPO3:用新的FAL映像扩展sys_file_metadata吗?多个FileProcessor?

时间:2019-01-17 21:09:08

标签: typo3 extbase

我用新的FAL对象“ teaserimages”扩展了sys_file_metadata。 TCA,模型,数据库等。后端中的所有内容都可以使用,但是当我像这样访问Fluid中的新属性时:

file.properties.teaserimages

它返回一个Int(FAL图像的计数)。

由于我需要“上传”的新属性,因此我尝试扩展tt_content.uploads打字稿:

tt_content.uploads = < lib.contentElement
tt_content.uploads {
templateName = Uploads
dataProcessing {
    10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
    10 {
        references.fieldName = media
        as = myfiles # Returns all Files as "myfiles"

        dataProcessing {                
            20 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
            20 {
                 references.fieldName = teaserimages
                 as = teaserimages
            }
         }
    }
}

因此,我可以对所有“ myfiles”进行插值,然后通过第二个文件处理器对所有文件的所有“ teaserimages”进行插值,但是以某种方式无法解决。我只能将DatabaseQueryProcessor彼此结合在一起,还是只能将DatabaseQueryProcessor结合在一个FilesProcessor中?

或者还有另一种读取预告图像的方法吗?

1 个答案:

答案 0 :(得分:0)

您在打字稿中做错了事。

这是执行此操作的正确方法:

tt_content.uploads =< lib.contentElement
tt_content.uploads {
  templateName = Uploads
  dataProcessing {
    10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
    10 {
      references.fieldName = media
      as = myfiles # Returns all Files as "myfiles"
    }

    20 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
    20 {
      references.fieldName = teaserimages
      as = teaserimages
    }
  }
}