Jump to:

520 Posts in 248 Topics by 263 members

Content Editor Discussions

SilverStripe Forums » Content Editor Discussions » Removing TinyMCE

Forum for content editors and CMS users.

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

Page: 1
Go to End
Author Topic: 2710 Views
  • Tonyair
    Avatar
    Community Member
    81 Posts

    Removing TinyMCE Link to this post

    Hello, guys.

    I replaced TinyMCE with other content editor, but i don't want to change core files, i wrote:

          Requirements::block('sapphire/thirdparty/tinymce/tiny_mce_src.js');
          Requirements::block('sapphire/javascript/tiny_mce_improvements.js');

    and
          $fields->removeFieldFromTab('Root.Content.Main', 'Content');
          $fields->addFieldToTab('Root.Content.Main', new HTEditField('Content'));
    in Page.php,

    everything works fine, but anyway I have tinymce lines in source code:

    <script type="text/javascript">//<![CDATA[

    if((typeof tinyMCE != 'undefined')) {
    ....
    //]]></script>

    How can i remove them or totally replace HtmlEditorField class w/o changing core files?

  • otiteca
    Avatar
    Community Member
    5 Posts

    Re: Removing TinyMCE Link to this post

    you can't.
    The reason is that, i consider /cms/javascript/LeftAndMain.js as being a core file, and in that file there's some references to tinymce!
    have a look at the end of the js file, you'll find some behaviour created to instantiate tinymce...

    So to completely remove the code you're talking about you got to edit the core files...

  • otiteca
    Avatar
    Community Member
    5 Posts

    Re: Removing TinyMCE Link to this post

    by the way which is the other editor you use, i'll also remove tinymce, as the HtmlEditorField is buggy for me, i'll create my own.
    i need to have multiple html editor in the same page, and it sucks with htmleditorfield when i do that.

  • Tonyair
    Avatar
    Community Member
    81 Posts

    Re: Removing TinyMCE Link to this post

    I blocked LeftAndMain.js too and created my own as long as tiny_mce_improvements.js and SS plugins for CKEditor

    function getCMSFields() {
          $fields = parent::getCMSFields();
          $fields->removeFieldFromTab('Root.Content.Main', 'Content');
          $fields->addFieldToTab('Root.Content.Main', new CkEditField('Content'));
    }

    CkEditField extended from HtmlEditorField

    But .. i commented out custom script requirement in HtmlEditorFieldConfig so i didn't change core files besides that one class, so I just asking about can I block custom script inclusion?

  • ud2013
    Avatar
    Community Member
    6 Posts

    Re: Removing TinyMCE Link to this post

    Sorry, I know this post is old, but I use ss3 and wish to use ckeditor instead of the tiny_mce editor. I have looked on google, but haven't found a good instruction on how to replace tiny_mce with ckeditor.

    Any help would be great.

    Thanks

  • forumq42
    Avatar
    Community Member
    12 Posts

    Re: Removing TinyMCE Link to this post

    I also would be quite interested to know (along with several others):

    - which SilverStripe version this works with (currently we run instances of 2.4.x until a 3.x migration plan is mapped out)

    - which editor you replaced TinyMCE with

    - detailed instructions

    It would be quite nice to try CKEditor as an alternative to TinyMCE and/or how to at least add an alternate HTML editor instead of TinyMCE's default HTML editor.

    2710 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.