Search code examples
hyperlinktypo3fluid

Create TYPO3 Fluid link for typolink fields generated by a link wizard


I regularly use the link wizard in my TCA.

Its horrible to find out with conditions which kind of link I have to render in Fluid (page/email/external). Is there a solution for this or do I have to create my own ViewHelper?


Solution

  • It seems to be undocumented, but you can pass it to <f:link.page> and it will be rendered correctly, even if it is external, email, or file link. This is because internally, <f:link.page> uses UriBuilder to build the URL, and that UriBuilder uses Typolink.

    <f:link.page pageUid="{myLinkFieldValue}">My link</f:link.page>