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

喜欢而已 提交于 2019-12-25 07:12:48

问题


Situation

sysext:filemetadata is activated; images (fal references) are deposited within page resources (pages.media).

2 options are currently known to me in conjunction to TYPO3 pages:

  1. Using a custom FAL viewhelper
  2. Using TypoScript (which is often illegible and not easy to maintain)

Question

What's actually (TYPO3 7.x and 8.x) a common/core-only solution to render such images within fluid with additional properties (metadata) like creator, copyright and so on?


回答1:


I would go for next approach:

typoscript

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

fluid

<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>

...

To find all possible sys_file_reference and sys_file_metadata properties just add <f:debug>{file.properties}</f:debug> inside the <f:for ...</f:for>.



来源:https://stackoverflow.com/questions/39837917/how-can-i-extract-metadata-properties-from-images-with-fal-and-fluid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!