Search code examples
typo3typoscripttypo3-9.x

Add a link to extension resource in TYPO3?


I want to add link tags to the head so I can preload some font files in my site package.

I have tried using headerData but how can I get file path to EXT:my_site/Resources?


Solution

  • For any field in TypoScript that uses the getText data type, you can use path: for that. For example:

    page.headerData.123 = TEXT
    page.headerData.123.data = path:EXT:extension/Resources/Public/path/to/file
    page.headerData.123.wrap = <tag property="|">
    

    See https://docs.typo3.org/m/typo3/reference-typoscript/10.4/en-us/DataTypes/#path for more information.