How to get rendered links of a HTML element in TYPO3 7.6

旧巷老猫 提交于 2019-12-02 11:17:12

问题


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>


来源:https://stackoverflow.com/questions/46306258/how-to-get-rendered-links-of-a-html-element-in-typo3-7-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!