.. include:: /Includes.rst.txt .. _typo3-fluid-format-html: ======================================== format.html ViewHelper `` ======================================== 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 :typoscript:`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 :html:`` to secure a given HTML string or :html:`` to parse links in HTML. Examples ======== Default parameters ------------------ :: {$myConstant.project} is a cool CMS (TYPO3). Output::

TYPO3 is a cool CMS (TYPO3).

Depending on TYPO3 constants. Custom parseFunc ---------------- :: TYPO3 is a cool CMS (TYPO3). Output:: TYPO3 is a cool CMS (TYPO3). Data argument -------------- If you work with TypoScript :typoscript:`field` property, you should add the current record as `data` to the ViewHelper to allow processing the `field` and `dataWrap` properties correctly. :: News title: After "dataWrap = |{FIELD:title}" you may have this Output:: News title: TYPO3, greatest CMS ever Current argument ----------------- Use the `current` argument to set the current value of the content object. :: I'm gone After `setContentToCurrent = 1` you may have this output:: Thanks Kasper for this great CMS CurrentValueKey argument ------------------------- Use the `currentValueKey` argument to define a value of data object as the current value. :: Content: After `dataWrap = |{CURRENT:1}` you may have this Output:: Content: How to install TYPO3 in under 2 minutes ;-) Inline notation --------------- :: {someText -> f:format.html(parseFuncTSPath: 'lib.parseFunc')} Output:: TYPO3 is a cool CMS (TYPO3). .. _parseFunc: https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/Parsefunc.html .. _typo3-fluid-format-html_arguments: Arguments ========= .. _format.html_parsefunctspath: parseFuncTSPath --------------- :aspect:`DataType` string :aspect:`Default` 'lib.parseFunc_RTE' :aspect:`Required` false :aspect:`Description` Path to the TypoScript parseFunc setup. .. _format.html_data: data ---- :aspect:`DataType` mixed :aspect:`Required` false :aspect:`Description` Initialize the content object with this set of data. Either an array or object. .. _format.html_current: current ------- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` Initialize the content object with this value for current property. .. _format.html_currentvaluekey: currentValueKey --------------- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` Define the value key, used to locate the current value for the content object .. _format.html_table: table ----- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` The table name associated with the "data" argument.