如何使用 FAL 和流体从图像中提取元数据属性?

How can I extract metadata properties from images with FAL and fluid?

情况

sysext:filemetadata已激活;图像(错误引用)存放在页面资源中 (pages.media)。

我目前知道 2 个选项与 TYPO3 页面有关:

  1. 使用自定义 FAL viewhelper
  2. 使用 TypoScript(通常难以辨认且不易维护)

问题

什么是真正的(TYPO3 7.x 和 8.x)common/core-only 解决方案来在具有附加属性(元数据)(如创作者、版权等)的流体中渲染此类图像?

我会选择下一个方法:

打字错误

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

流体

<f:for each="{files}" as="file">
    <div class="media">
        <figure>
            <f:media file="{file}" />
            <figcaption>
                {file.description}<br />
                author: {file.properties.creator}<br />
                copyright: {file.properties.copyright}
            </figcaption>
        </figure>
    </div>
</f:for>

...

要查找所有可能的 sys_file_referencesys_file_metadata 属性,只需在 <f:for ...</f:for>.

中添加 <f:debug>{file.properties}</f:debug>