TYPO3 Mask Elements - Wrong output

206 views Asked by At

I am using TYPO3's mask element extension to create a mask element. There I'm using a RTE to enter some text and print it to the screen. The HTML for the mask element looks like this:

<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. So if I type in "Hello" as text into the RTE, then the output is <p>Hello</p>.

Any idea how to fix this?

1

There are 1 answers

0
JKD On BEST ANSWER

I had a similar issue. All you need to do is add some ViewHelper to your variable, which should be printed, in your case:

<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. See further information here:

https://docs.typo3.org/other/typo3/view-helper-reference/9.5/en-us/typo3/fluid/latest/Format/Html.html