Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
Format.html ViewHelper <f:format.html>
Renders a string by passing it to a TYPO3 parseFunc.
You can either specify a path to the TypoScript setting or set the parseFunc options directly.
By default lib.
is used to parse the string.
The view helper must not be used in backend context, as it triggers frontend logic.
Instead, use <f:
to secure a given HTML string or <f:
to parse links in HTML.
Examples
Default parameters
<f:format.html>foo <b>bar</b>. Some <LINK 1>link</LINK>.</f:format.html>
Output:
<p class="bodytext">foo <b>bar</b>. Some <a href="index.php?id=1" >link</a>.</p>
Depending on TYPO3 setup.
Custom parseFunc
<f:format.html parseFuncTSPath="lib.parseFunc">foo <b>bar</b>. Some <LINK 1>link</LINK>.</f:format.html>
Output:
foo <b>bar</b>. Some <a href="index.php?id=1" >link</a>.
Inline notation
{someText -> f:format.html(parseFuncTSPath: 'lib.parseFunc')}
Output:
foo <b>bar</b>. Some <a href="index.php?id=1" >link</a>.
Source code
Go to the source code of this ViewHelper: HtmlViewHelper.php (GitHub).
Arguments
The following arguments are available for <f:
:
parseFuncTSPath
-
- Type
- string
- Default
'lib.
parse Func_ RTE'
Path to TypoScript parseFunc setup.