Access to variables in fluid_styled_content partials

410 Views Asked by At

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?

2

There are 2 best solutions below

0
On BEST ANSWER

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

1
On

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}