Override core TinyMCE

156 views
Skip to first unread message

Viktor Iwan

unread,
Feb 15, 2017, 11:11:17 AM2/15/17
to Joomla! General Development
Hello,
 i would like to extend TinyMCE editor to use a dynamic template. At this moment, i'm already able to achieve this by doing core hack on plugins/editors/tinymce/tinymce.php

on around line 609, i change :
$templates = 'templates: [';

to 

$templates ='templates: "/path/template.php"';

Now my question if is it possible to achieve this without hacking the core code ? i tried  Plugin Layout Override as describe here: https://docs.joomla.org/Layout_Overrides_in_Joomla#Plugin_Alternative_Layouts_.28Overriding_a_Plugin.29 

but failed since the editor does not have output/tmpl

Thanks for your input

Hannes Papenberg

unread,
Feb 16, 2017, 2:57:10 PM2/16/17
to joomla-de...@googlegroups.com
Easiest way: Copy the tinymce plugin under a new name and create your
own version of it.

Hannes
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-gene...@googlegroups.com>.
> To post to this group, send email to joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/joomla-dev-general.
> For more options, visit https://groups.google.com/d/optout.

Viktor Iwan

unread,
Feb 19, 2017, 10:00:56 AM2/19/17
to Joomla! General Development
Yes, that one of my approach right now..i just thought there's a 'official' way to do it... 

Thanks


On Friday, February 17, 2017 at 2:57:10 AM UTC+7, Hannes Papenberg wrote:
Easiest way: Copy the tinymce plugin under a new name and create your
own version of it.

Hannes

Am 15.02.2017 um 17:11 schrieb Viktor Iwan:
> Hello,
>  i would like to extend TinyMCE editor to use a dynamic template. At
> this moment, i'm already able to achieve this by doing core hack on
> plugins/editors/tinymce/tinymce.php
>
> on around line 609, i change :
> $templates = 'templates: [';
>
> to
>
> $templates ='templates: "/path/template.php"';
>
> Now my question if is it possible to achieve this without hacking the
> core code ? i tried  Plugin Layout Override as describe
> here: https://docs.joomla.org/Layout_Overrides_in_Joomla#Plugin_Alternative_Layouts_.28Overriding_a_Plugin.29
>
> but failed since the editor does not have output/tmpl
>
> Thanks for your input
>
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send

Ove Eriksson

unread,
Feb 24, 2017, 12:44:05 PM2/24/17
to Joomla! General Development
A lot happend to the TinyMCE code within Joomla the last 6 months. Among other things you can override almost everything with a system-plugin using method onBeforeRender().

// Get the editor options
$doc
= JFactory::getDocument();
$editorOptions
= $doc->getScriptOptions('plg_editor_tinymce');

// Change,add,remove options and then set them

$doc
->addScriptOptions('plg_system_oejcbmce', $oejcbmceOptions);



See Joomla GitHub issue #11157 by Fedik and other more recent ones.



Ove Eriksson

unread,
Feb 24, 2017, 12:52:47 PM2/24/17
to Joomla! General Development
Sorry : corrected - addScriptOptions - below.


// Get the editor options
$doc
= JFactory::getDocument();
$editorOptions
= $doc->getScriptOptions('plg_editor_tinymce');

// Change,add,remove options and then set them


$doc->addScriptOptions('plg_editor_tinymce', $editorOptions);



Reply all
Reply to author
Forward
0 new messages