Rendering RTE content in the Frontend
The explanations on this page don't show how to display an RTE but rather, describe how rendering of content should be done in the frontend when it was entered with help of an RTE.
Note
For including an RTE in the frontend you can read Using an RTE in the frontend.
Fluid templates
Rich text editors enrich content with HTML and pseudo HTML (for example a special link syntax). You should therefore always render the output of a RTE field with the Format.html ViewHelper <f:format.html>:
<f:format.html>{data.bodytext}</f:format.html>
TypoScript
Rendering is sometimes done by TypoScript only, in those cases it is possible to
use lib.
for parsing and rendering (see also
TypoScript function parseFunc):
For example to render the bodytext
filed of table tt_
without Fluid:
tt_content.my_content_element = TEXT
tt_content.my_content_element {
field = bodytext
wrap = <p>|</p>
stdWrap.parseFunc < lib.parseFunc_RTE
}
Usually the TypoScript function typolink
should be used for single links,
but for text that might include several links that is not possible easily.
Therefore lib.
is used to simplify and streamline this process.
Details to parse
can be found in the TypoScript Reference: