0

I have cloned the file sysext/fluid_styled_content/Resources/Private/Partials/Media/Type/Image.html into my own template directory and set the constant to use that path. This works fine.

Now I want to output the "source" metadata of the image (which you can edit from the files list or some other places) additionally.

In debug output of {file} I can see this data under the branch {file.originalFile.metaDataAspect.source}.

But if I want to use this data to output there comes an error message Cannot access private property TYPO3\CMS\Core\Resource\File::$metaDataAspect.

How can I access this data in my modified fluid_styled_content template?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38

2 Answers2

0

The chapter "Get File Properties" of the File Abstraction Layer documentation is telling:

If you have a file reference and want to get its properties like Metadata, you have to access “originalResource” first. Example:

{filereference.originalResource.title}
{filereference.originalResource.description}
{filereference.originalResource.publicUrl}

So, for the property "source", the following should work:

{file.originalFile.source}
Julian Hofmann
  • 2,081
  • 1
  • 8
  • 16
  • This does not work. There are no properties like ```{filereference.originalResource.title}```. I tried it with ```{filereference.originalFile....}``` but it does not work too. I used the newer docs https://docs.typo3.org/m/typo3/reference-coreapi/10.4/en-us/ApiOverview/Fal/UsingFal/Frontend.html – René Teinze May 04 '21 at 07:48
0

The data are stored inside the properties of an array not(!) shown by <f:debug>{filereference}</f:debug>.

The data come from the system extension "filemetadata". One can access the file metadata by using {filereferce.properties.source} or any other detail you want. You can get a list of all provided properties by using <f:debug>{filereference.properties}</f:debug>

Source: Using FAL in the Frontend