-->

How to get rendered links of a HTML element in TYP

2020-04-27 00:19发布

问题:

IN TYPO3 versions before 7.6 it was possible to render links inside the content element HTML by using the TypoScript

tt_content.html.parseFunc.tags.link < lib.parseFunc.tags.link

This does not work anymore since 7.6. How can it be solved?

回答1:

There are a couple of possible solutions for this question.

1.) Use fluid_styled_content.

I guess that now fluid_styled_content instead of css_styled_content is used. Therefore the used TypoScript does not work anymore. A valid solution would be to switch back to css_styled_content. However that is the old ancient way and for newer projects you shouldn't do this.

2.) Override the template of fluid_styled_content.

If you open the template of fluid_styled_content and the HTML element, found at typo3/sysext/fluid_styled_content/Resources/Private/Templates/Html.html you will see

<f:format.raw>{data.bodytext}</f:format.raw>

this must be changed to

<f:format.html>{data.bodytext}</f:format.html>

Overriding is described in the docs, see https://docs.typo3.org/typo3cms/extensions/fluid_styled_content/7.6/Configuration/OverridingFluidTemplates/Index.html



回答2:

If you use fluid_styled_content, override the HTML.html and want to use forms and have the Typo3 link tags <link>text</link> converted to html links, you will have to use this (at least this worked for me, both custom html forms were working and links were converted):

<f:format.htmlentitiesDecode>
    <f:format.html parseFuncTSPath="lib.parseFunc">
        {data.bodytext}
    </f:format.html>
</f:format.htmlentitiesDecode>