0
votes

I am using jce editor in my joomla and it's my default editor. now I want use tinymce editor in my custom component at frontend Without changing the default editor. I get editor by this code:

  $editor = JFactory::getEditor();
  echo $editor->display('content', $this->content, '550', '400', '60', '20', false);

but it's only show my default editor. I want only use tinymce in my custom component fronted.

1

1 Answers

1
votes

First of all getEditor() is deprecated and you should not be using it for new code. Please review the docblocks and as instructed use JEditor instead.

If you read the docblocks you will see that the name of the editor is a property of the editor object. By default the constructor uses 'none' but you can put what you want.

However, more importantly, in your xml form (as illustrated in com_templates) you can specify the editor

<field
    name="source"
    type="editor"
    editor="codemirror|none"
    buttons="no"
    label="COM_TEMPLATES_FIELD_SOURCE_LABEL"
    description="COM_TEMPLATES_FIELD_SOURCE_DESC"
    height="500px"
    rows="20"
    cols="80"
    syntax="php"
    filter="raw" />

Make sure you check that the editor is present and enabled, otherwise fall back to none.