droplet
droplet

Reputation: 286

Joomla JEditor display() doesn't load the editor

I've been battling this all morning and can't seem to find anything on how this works. I need the editor (system default) to show up in my back-end component.

My default editor is TinyMCE I'm on Joomla 2.5.x

This is how far I've gotten with searching this forum and google.

Sample of my script

jimport( 'joomla.html.editor' );
$editor =& JEditor::getInstance();
echo $editor->display("desc", $itemData['body'], "600", "400", "80", "15", 1, null, null, null, array('mode' => 'advanced'));

All I'm getting is a HTML textarea with my content from the $itemData['body']. No editor. What am I missing?

THIS IS NOW SOLVED.

I did some more research and learned to use Joomla's JForm to create nice forms and have more control in my component in the back end.

Upvotes: 1

Views: 3264

Answers (2)

Kenneth Hippolite
Kenneth Hippolite

Reputation: 96

Joomla 4 / 5:

use Joomla\CMS\Editor\Editor;
$editor = Editor::getInstance();
echo $editor->display('editorname', $this->detail->namechamp, '100%', '300', '75', '20');

or (without adding to the namespace). In this second example, I picked a particular editor

$editor = Joomla\CMS\Editor\Editor::getInstance('tinymce');

Upvotes: 0

Rudolf Pipopulo
Rudolf Pipopulo

Reputation: 110

jimport( 'joomla.html.editor' );
$editor = &JFactory::getEditor();
echo $editor->display('editorname', $this->detail->namechamp, '100%', '300', '75', '20');

Upvotes: 2

Related Questions