【问题标题】:How to get rendered links of a HTML element in TYPO3 7.6如何在 TYPO3 7.6 中获取 HTML 元素的渲染链接
【发布时间】:2017-09-19 17:14:18
【问题描述】:

在 7.6 之前的 TYPO3 版本中,可以使用 TypoScript 在内容元素 HTML 内呈现链接

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

这在 7.6 之后不再起作用。怎么解决?

【问题讨论】:

    标签: typo3 typoscript typo3-7.6.x


    【解决方案1】:

    如果你使用fluid_styled_content,覆盖HTML.html并希望使用表单将Typo3链接标签&lt;link&gt;text&lt;/link&gt;转换为html链接,你将不得不使用这个(至少这个有效对我来说,两个自定义 html 表单都可以正常工作,并且链接已转换):

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

    【讨论】:

    【解决方案2】:

    这个问题有几个可能的解决方案。

    1.) 使用 fluid_styled_content。

    现在使用的是fluid_styled_content 而不是css_styled_content。因此使用的 TypoScript 不再起作用。一个有效的解决方案是切换回 css_styled_content。但是,这是古老的方式,对于较新的项目,您不应该这样做。

    2.) 覆盖fluid_styled_content的模板。

    如果你打开fluid_styled_content的模板和HTML元素,在typo3/sysext/fluid_styled_content/Resources/Private/Templates/Html.html你会看到

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

    这个必须改成

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

    文档中描述了覆盖,请参阅https://docs.typo3.org/typo3cms/extensions/fluid_styled_content/7.6/Configuration/OverridingFluidTemplates/Index.html

    【讨论】:

    • 不幸的是,这在 Typo3 9.5.7 中对我不起作用,请参见此处:stackoverflow.com/questions/56473965/…
    • 更新:我遇到此问题以及上述解决方案不起作用的原因是我在 powermail 公式中使用了 HTML 元素。在 HTML 元素中启用typo3 链接的呈现确实如上所述,但在powermail 公式中则不行...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-25
    • 1970-01-01
    • 1970-01-01
    • 2021-05-01
    • 2015-01-04
    • 2021-12-09
    相关资源
    最近更新 更多