简体   繁体   English

TYPO3 流体:f:format.html 在后端删除链接

[英]TYPO3 fluid: f:format.html in backend removes links

I am using flux 9.5.0 in TYPO3 9.5.31 to create a simle "text" content element.我在 TYPO3 9.5.31 中使用 flux 9.5.0 创建一个简单的“文本”内容元素。

It has a preview section that is displayed in the TYPO3 backend with <f:format.html> :它有一个预览部分,显示在 TYPO3 后端,带有<f:format.html>

  <f:section name="Preview">
    <f:format.html>{settings.text}</f:format.html>
  </f:section>

Unfortunately, links get removed and are not even their text displayed.不幸的是,链接被删除,甚至不显示其文本。

Example:例子:

  • HTML in RTE: <p>before <a href="https://cweiske.de/" target="_blank">link</a> after</p> RTE 中的 HTML: <p>before <a href="https://cweiske.de/" target="_blank">link</a> after</p>
  • Rendered output in preview: before after在预览中呈现 output: before after

How can I get the links in the preview section rendered?如何获得呈现的预览部分中的链接?

This is a problem with TYPO3's fluid.这是TYPO3的油液有问题。

TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::simulateFrontendEnvironment() creates a dummy TSFE instance. TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::simulateFrontendEnvironment()创建一个虚拟 TSFE 实例。

TYPO3's ContentObjectRenderer expects $TSFE->cObjectDepthCounter to be > 0 when rendering nested tags in cObjGetSingle , and this fails because the dummy TSFE instance does not have this variable set. TYPO3 的ContentObjectRenderercObjGetSingle中呈现嵌套标签时期望$TSFE->cObjectDepthCounter > 0,这失败了,因为虚拟 TSFE 实例没有设置此变量。


This problem is known since 2015: Bug #66855: Format/HtmlViewHelper don't render Links in TYPO3_MODE = BE自 2015 年以来已知此问题:错误 #66855:Format/HtmlViewHelper 不呈现 TYPO3_MODE = BE 中的链接

According to https://forge.typo3.org/issues/67556 and https://forge.typo3.org/issues/96535 this is "fixed" in TYPO3 v11.5 if you switch to <f:transform.html> .根据https://forge.typo3.org/issues/67556https: //forge.typo3.org/issues/96535 如果您切换到<f:transform.html> ,这将在 TYPO3 v11.5 中“修复” .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM