如何在 TYPO3 前端显示 rte 内容时省略 html 标签?

How can I omit html tags with displaying rte content on the TYPO3 frontend?

我正在使用流畅的 RTE(富文本编辑器)查询文本,因此它与前端一起显示,包括 HTML 标签(与 RTE 一起使用)。我怎样才能省略那些 HTML 标签(而不是让他们评估)?为什么还要显示它们(作为纯文本)?我将 RTE 与自定义内容元素一起使用。我应该查看该元素吗?

在模板中直接使用时,Fluid 中的变量默认通过htmlspecialchars传递。要在后端 RTE 中输出 HTML 输入,您需要用 <f:format.html> 标记将其包围。例如:<f:format.html>{myVariable}</f:format.html>。如果需要,这也可以添加 p-tags,用实际链接替换 ​​<link...> 标签等。有关此 ViewHelper 的更多信息,您可以在 https://docs.typo3.org/other/typo3/view-helper-reference/master/en-us/typo3/fluid/latest/Format/Html.html

找到

如果你想按原样添加一个变量,不做任何处理,你应该用 <f:format.raw> 标签包围它。例如:<f:format.raw>{myVariable}</f:format>。有关此 ViewHelper 的更多信息,请访问 https://docs.typo3.org/other/typo3/view-helper-reference/master/en-us/typo3fluid/fluid/latest/Format/Raw.html