0

I have a file collection containing xml files.

In my fluid template I iterate over the files. Is there a way to extract the xml from a file and decode into a fluid array, similar to the json-decode viewhelper, but with a file reference as argument?

I am grateful for any hint.

thanx in advance,

Jan

1 Answers1

1

You can do that in Fluid by registering your own ViewHelper and using PHP. See https://docs.typo3.org/m/typo3/book-extbasefluid/master/en-us/8-Fluid/8-developing-a-custom-viewhelper.html

Probably it would be better practice to do that outside of the view. Depending on how your Fluid is rendered, that could be in an Extbase controller or in the case of TypoScript/FLUIDTEMPLATE in a custom DataProcessor (https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/ContentObjects/Fluidtemplate/Index.html#dataprocessing).

To transform your FileReference-uid into data have a look here: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Fal/UsingFal/ExamplesFileFolder.html

Jonas Eberle
  • 2,835
  • 1
  • 15
  • 25