Reputation: 35
I call the editor and it apears, but it's extended version, which is set globaly for admin of whole page, and I want it to stay there that way.
But in my component I want an advance version of tinymce.
Here's code how i call tinymce:
$editor = JFactory::getEditor();
$editor =& JFactory::getEditor('tinymce');
$params = array(
'mode' => 'advanced'
);
echo $editor->display('opis_long', $this->info['opis_long'], '10', '10', '1', '1', false, $params);
Upvotes: 2
Views: 974
Reputation: 121
// IMPORT EDITOR CLASS
jimport( 'joomla.html.editor' );
// GET EDITOR SELECTED IN GLOBAL SETTINGS
$config = JFactory::getConfig();
$global_editor = $config->get( 'editor' );
// GET USER'S DEFAULT EDITOR
$user_editor = JFactory::getUser()->getParam("editor");
if($user_editor && $user_editor !== 'JEditor') {
$selected_editor = $user_editor;
} else {
$selected_editor = $global_editor;
}
// INSTANTIATE THE EDITOR
$editor = JEditor::getInstance($selected_editor);
// SET EDITOR PARAMS
$params = array( 'smilies'=> '0' ,
'style' => '1' ,
'layer' => '0' ,
'table' => '0' ,
'clear_entities'=>'0',
'mode' => '1'
);
// DISPLAY THE EDITOR (name, html, width, height, columns, rows, bottom buttons, id, asset, author, params)
echo $editor->display('opis_long', $this->info['opis_long'], '400', '400', '20', '20', true, null, null, null, $params);
core code from: How to add joomla editor in custom component view but without using XML form fields?
Upvotes: 1