Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Load tinymce plugin

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1376 Views
  • spankmaster79
    Avatar
    Community Member
    46 Posts

    Load tinymce plugin Link to this post

    Hi,

    I've downloaded a plugin for tinyMCE I want to use in the CMS Silverstripe backend. I've tried to add the line in mysite/_config.php as told in http://doc.silverstripe.org/htmleditorconfig

    HtmlEditorConfig::get('cms')->enablePlugins('../../textmetrics');
    HtmlEditorConfig::get('cms')->addButtonsToLine(2, 'textmetrics'); // positions plugin

    And added the Plugin into /sapphire/thirdparty/tinymce/plugins/textmetrics.

    That didn't work. So I tried to do the same as in /cms/_config.php where the configuration is set for the editor and put the plugin into /cms/javascript/tinymce_textmetrics. Then I tried to load with

    HtmlEditorConfig::get('cms')->enablePlugins(array('textmetrics' => '../../../cms/javascript/textmetrics/editor_plugin_src.js'));
    HtmlEditorConfig::get('cms')->insertButtonsBefore('tablecontrols', 'textmetrics'); // positions plugin

    I've tried to use insertButtonsBefore insteat of addButtonsToLine just to see if there was a problem.

    But nothing happens at all.... not even errormessages and I don't know what to do. I need extra plugins to load.

    Help appreciated.
    Thx Spanky

  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    Re: Load tinymce plugin Link to this post

    Don't put the path in the plugin name when enabling the plugin.
    It should be

    HtmlEditorConfig::get('cms')->enablePlugins('textmetrics');


    if that's the name of the plugin.

  • spankmaster79
    Avatar
    Community Member
    46 Posts

    Re: Load tinymce plugin Link to this post

    That's what I tried. I found out the plugin wasn't working and I tried another one. This works with

    HtmlEditorConfig::get('cms')->enablePlugins(array('youtube' => '../../../cms/javascript/youtube/editor_plugin_src.js'));
    HtmlEditorConfig::get('cms')->insertButtonsBefore('tablecontrols', 'youtube'); // positions plugin*/

    You'rs might work too

    1376 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.