[英]TYPO3 Mask Elements - Wrong output
I am using TYPO3's mask element extension to create a mask element.我正在使用 TYPO3 的掩码元素扩展来创建掩码元素。 There I'm using a RTE to enter some text and print it to the screen.
我正在使用 RTE 输入一些文本并将其打印到屏幕上。 The HTML for the mask element looks like this:
掩码元素的 HTML 如下所示:
<f:if condition="{data.tx_mask_text}">{data.tx_mask_text}<br /></f:if>
The problem now is that I can add some text here and it also is printed.现在的问题是我可以在这里添加一些文本并且它也被打印出来了。 But the text also includes HTML tags.
但文本还包括 HTML 标签。 So if I type in "Hello" as text into the RTE, then the output is
<p>Hello</p>
.因此,如果我在 RTE 中输入“Hello”作为文本,那么 output 就是
<p>Hello</p>
。
Any idea how to fix this?知道如何解决这个问题吗?
I had a similar issue.我有一个类似的问题。 All you need to do is add some ViewHelper to your variable, which should be printed, in your case:
您需要做的就是将一些 ViewHelper 添加到您的变量中,在您的情况下应该打印它:
<f:if condition="{data.tx_mask_text}">{data.tx_mask_text -> f:format.html(parseFuncTSPath: 'lib.parseFunc')}<br /></f:if>
The ViewHelper removes all the tags from the text. ViewHelper 从文本中删除所有标签。 See further information here:
在此处查看更多信息:
https://docs.typo3.org/other/typo3/view-helper-reference/9.5/en-us/typo3/fluid/latest/Format/Html.html https://docs.typo3.org/other/typo3/view-helper-reference/9.5/en-us/typo3/fluid/latest/Format/Html.ZFC35FDC70D5FC69D239EZ83A
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.