How to make Joomla 3.0 rich text editor allow HTML?

joomla, joomla2.5, joomla3.0, php, tinymce

Solution

HINT for your JModel:

Be aware that JRequest::GET by default filters all HTML-code down to plain text, which might not be very useful when using the editor. To store HTML-code within your model class you MUST explicitely request HTML-Code from the JRequest-Object, otherwise all HTML will be stripped.

JRequest::getVar( 'yourfieldname', '', 'post', 'string', JREQUEST_ALLOWHTML );

`JREQUEST_ALLOWHTML` is the key point to remember. Given that

- JREQUEST_NOTRIM - prevents trimming of whitespace

- JREQUEST_ALLOWRAW - bypasses filtering

- JREQUEST_ALLOWHTML - allows most HTML. If this is not passed in, HTML is stripped out by default.

Problem

In Joomla 2.5 I use below code generate a rich text editor and it allows me to enter HTML and save it in the database. Code is below. ``` <?php $editor = & JFactory::getEditor(); $params = array('smilies'=> '0' ,'style' => '0' ,'layer' => '0' ,'table' => '0' ,'clear_entities'=>'0'); echo $editor->display('description',$description , 550, 400, 60, 20, false, $params); ?> ``` But in the Joomla 3.0 I use the same code but rich text editor does not allow me to enter HTML. Editor in the Article Manager rich text editor allows me to enter HTML. Why does this editor does not? How can I fix this? What extra parameters should be passed to allow rich text editor to allow HTML?

Original source