Skip to content

Commit 1537b59

Browse files
committed
[TASK] Suggest to use <f:render.text> for records
Releases: main
1 parent b35e508 commit 1537b59

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

Documentation/Global/Format/Html.rst

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
Format.html ViewHelper `<f:format.html>`
88
========================================
99

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+
1019
.. typo3:viewhelper:: format.html
1120
:source: ../../Global.json
1221
:display: tags,description,gitHubLink
@@ -81,26 +90,38 @@ With a custom parsing function defined in TypoScript:
8190
.. _typo3-fluid-format-html-arguments-data:
8291

8392
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.
85103

86104
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
88108
`{FIELD:title}` are resolved correctly.
89109

90110
.. code-block:: html
91111

92112
<f:format.html
93-
data="{newsRecord}"
113+
data="{someDto}"
94114
parseFuncTSPath="lib.myParseFunc"
95115
>
96-
News title:
116+
You entered the following in the form:
97117
</f:format.html>
98118

99119
You may get the following output:
100120

101121
.. code-block:: html
102122

103-
News title: <strong>TYPO3, greatest CMS ever</strong>
123+
You entered the following in the form:
124+
<strong>TYPO3, greatest CMS ever</strong>
104125

105126
With a custom parsing function defined in TypoScript:
106127

@@ -156,7 +177,7 @@ current value.
156177
.. code-block:: html
157178

158179
<f:format.html
159-
data="{contentRecord}"
180+
data="{someDto}"
160181
currentValueKey="header"
161182
parseFuncTSPath="lib.content"
162183
>

Documentation/Global/Format/Nl2br.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
Format.nl2br ViewHelper `<f:format.nl2br>`
99
==========================================
1010

11+
.. versionchanged:: 14.0
12+
13+
The `Render.text ViewHelper <f:render.text> <https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-render-text>`_
14+
should be used whenever text fields from records are
15+
displayed in HTML output.
16+
17+
Depending on the TCA definition of the rendered field `nl2br` is then
18+
automatically applied for multi line text areas.
19+
1120
.. typo3:viewhelper:: format.nl2br
1221
:source: ../../Global.json
1322
:display: tags,description,gitHubLink

0 commit comments

Comments
 (0)