问题
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:
- Using a custom FAL viewhelper
- 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