typo3fluidtypo3-7.6.xtypo3-7.x

Link to file in Fluid – how to specify storage?


As far as I know, there's no such thing as an f:link.file or v:link.file viewhelper.

There used to be a solution using file.originalResource.publicUrl as the value to point the link to, as in

<f:link.page pageUid="{file.originalResource.publicUrl}" target="_blank">

Am I right that this is no longer necessary? I got this (using ext:mask):

<f:link.page pageUid="{file.identifier}" target="_blank">

returning the same value, while originalResource.publicUrl would not even show up in f:debug.

BUT in file.identifier the storage path, e.g. fileadmin, is not present. How do I add it to the viewhelper?

Or, what is the currently recommended solution for a link to a file in TYPO3 7.6?


Solution

  • TYPO3 11 introduced a new ViewHelper for this

    <f:link.file file="{file}" target="_blank">Download</f:link.file>

    https://docs.typo3.org/other/typo3/view-helper-reference/11.5/en-us/typo3/fluid/latest/Link/File.html