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.parseFunc_RTE is used to parse the string.

The view helper must not be used in backend context, as it triggers frontend logic. Instead, use <f:sanitize.html /> to secure a given HTML string or <f:transform.html /> to parse links in HTML.

Examples

Default parameters

<f:format.html>foo <b>bar</b>. Some <LINK 1>link</LINK>.</f:format.html>
Copied!

Output:

<p class="bodytext">foo <b>bar</b>. Some <a href="index.php?id=1" >link</a>.</p>
Copied!

Depending on TYPO3 setup.

Custom parseFunc

<f:format.html parseFuncTSPath="lib.parseFunc">foo <b>bar</b>. Some <LINK 1>link</LINK>.</f:format.html>
Copied!

Output:

foo <b>bar</b>. Some <a href="index.php?id=1" >link</a>.
Copied!

Inline notation

{someText -> f:format.html(parseFuncTSPath: 'lib.parseFunc')}
Copied!

Output:

foo <b>bar</b>. Some <a href="index.php?id=1" >link</a>.
Copied!

Source code

Go to the source code of this ViewHelper: HtmlViewHelper.php (GitHub).

Arguments

The following arguments are available for <f:format.html>:

Name Type Default
string 'lib.parseFunc_RTE'
parseFuncTSPath
Type
string
Default
'lib.parseFunc_RTE'

Path to TypoScript parseFunc setup.