[TYPO3-english] How to format text entered in an RTE-field?

Bart van den Burg bart at samson-it.nl
Wed Jan 5 17:16:44 CET 2011


I created an extension with a table with one RTE column. Now in my 
plugin I want to display the text the user entered, but in the database 
it's stored not completely as HTML.

How do I transform this to HTML, so the visitor can see this text as it 
should be? I've been pulling my hair for two days now trying to figure 
it out, but have been unsuccessful so far. I thought I had the sollution:

$pageId = $this->conf->data['pid'];
$field='omschrijving';
$table='tx_excent_vacature';
$parameters = "flag=rte_enabled|mode=ts_css-ts_links";
$RTEsetup = 
$GLOBALS['BE_USER']->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($pageId));
$RTEtypeVal = t3lib_BEfunc::getTCAtypeValue($table,$pageId);
$thisConfig = 
t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$table,$field,$RTEtypeVal);
$parsehtml_proc = t3lib_div::makeInstance("t3lib_parsehtml_proc");
$specConf['rte_transform']['parameters'] = explode("|",$parameters);
$direction = "rte";
$omschrijving = 
$parsehtml_proc->RTE_transform($row['omschrijving'],$specConf,$direction,$thisConfig);

This works fine, but results in a fatal error on the line 
$GLOBALS['BE_USER']->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($pageId));, 
when the visitor is not signed in to the backend.

How do I transform a piece of RTE text to HTML? And why is it so 
difficult to find the answer to this on Google? It sounds like something 
that every plugin writer uses, but i can find nothing...

Thanks in advance,

Regards,
Bart


More information about the TYPO3-english mailing list