|
7 | 7 | Format.html ViewHelper `<f:format.html>` |
8 | 8 | ======================================== |
9 | 9 |
|
| 10 | +.. versionchanged:: 14.0 |
| 11 | + |
| 12 | + The `Render.text ViewHelper <f:render.text> <https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-render-text>`_ |
| 13 | + should be used whenever text fields from records are |
| 14 | + displayed in HTML output. |
| 15 | + |
| 16 | + Depending on the TCA definition of the rendered field `nl2br` is then |
| 17 | + automatically applied for multi line text areas. |
| 18 | + |
10 | 19 | .. typo3:viewhelper:: format.html |
11 | 20 | :source: ../../Global.json |
12 | 21 | :display: tags,description,gitHubLink |
@@ -81,26 +90,38 @@ With a custom parsing function defined in TypoScript: |
81 | 90 | .. _typo3-fluid-format-html-arguments-data: |
82 | 91 |
|
83 | 92 | Data argument |
84 | | --------------- |
| 93 | +------------- |
| 94 | + |
| 95 | +.. versionchanged:: 14.0 |
| 96 | + |
| 97 | + The `Render.text ViewHelper <f:render.text> <https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-render-text>`_ |
| 98 | + should be used whenever text fields from records are |
| 99 | + displayed in HTML output. |
| 100 | + |
| 101 | + Depending on the TCA definition of the rendered field `nl2br` is then |
| 102 | + automatically applied for multi line text areas. |
85 | 103 |
|
86 | 104 | If you use TypoScript properties such as :typoscript:`field` or :typoscript:`dataWrap`, |
87 | | -you should pass the current record as `data`. This ensures that field references like |
| 105 | +you should pass structured data |
| 106 | +(`Data transfer object (DTO) <https://docs.typo3.org/permalink/t3coreapi:extbase-dto>`_ |
| 107 | +or named array) as `data`. This ensures that field references like |
88 | 108 | `{FIELD:title}` are resolved correctly. |
89 | 109 |
|
90 | 110 | .. code-block:: html |
91 | 111 |
|
92 | 112 | <f:format.html |
93 | | - data="{newsRecord}" |
| 113 | + data="{someDto}" |
94 | 114 | parseFuncTSPath="lib.myParseFunc" |
95 | 115 | > |
96 | | - News title: |
| 116 | + You entered the following in the form: |
97 | 117 | </f:format.html> |
98 | 118 |
|
99 | 119 | You may get the following output: |
100 | 120 |
|
101 | 121 | .. code-block:: html |
102 | 122 |
|
103 | | - News title: <strong>TYPO3, greatest CMS ever</strong> |
| 123 | + You entered the following in the form: |
| 124 | + <strong>TYPO3, greatest CMS ever</strong> |
104 | 125 |
|
105 | 126 | With a custom parsing function defined in TypoScript: |
106 | 127 |
|
@@ -156,7 +177,7 @@ current value. |
156 | 177 | .. code-block:: html |
157 | 178 |
|
158 | 179 | <f:format.html |
159 | | - data="{contentRecord}" |
| 180 | + data="{someDto}" |
160 | 181 | currentValueKey="header" |
161 | 182 | parseFuncTSPath="lib.content" |
162 | 183 | > |
|
0 commit comments