AfterTransformTextForRichTextEditorEvent

Modify data when retrieving content from the database and pass to the rich-text-editor (RTE). As opposed to BeforeTransformTextForRichTextEditorEvent this event is executed after TYPO3 applied any kind of internal transformations like for links.

When using a RTE HTML content element, two transformations take place within the TYPO3 backend:

  • From database: Fetching the current content from the database (`persistence`) and preparing it to be displayed inside the RTE HTML component.
  • To database: Retrieving the data returned by the RTE and preparing it to be persisted into the database.

This event can modify the first part. This allows developers to apply more customized transformations, apart from the internal and API ones.

Event listeners can use $value = $event->getHtmlContent() to get the current contents, apply changes to $value and then store the manipulated data via $event->setHtmlContent($value), see example: Example: Transform a text before saving to database.

API of AfterTransformTextForRichTextEditorEvent

class AfterTransformTextForRichTextEditorEvent
Fully qualified name
\TYPO3\CMS\Core\Html\Event\AfterTransformTextForRichTextEditorEvent

Event that is fired after RteHtmlParser modified the HTML input from the database to the RTE editor (for example transforming linebreaks)

getHtmlContent ( )
Returns
string
setHtmlContent ( string $htmlContent)
param $htmlContent

the htmlContent

getInitialHtmlContent ( )
Returns
string
getProcessingConfiguration ( )
Returns
array