René Teinze
René Teinze

Reputation: 49

Access to variables in fluid_styled_content partials

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?

Upvotes: 0

Views: 527

Answers (2)

René Teinze
René Teinze

Reputation: 49

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

Upvotes: 0

Julian Hofmann
Julian Hofmann

Reputation: 2592

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}

Upvotes: 0

Related Questions