Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Remove Image and Flash Button from TinyMCE

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

Page: 1
Go to End
Author Topic: 1923 Views
  • Silverfish
    Avatar
    Community Member
    59 Posts

    Remove Image and Flash Button from TinyMCE Link to this post

    Hi there,

    does anyone know how to remove the 'Insert Image' and the 'Insert Flash' button from the HTML editor?

    I tried HtmlEditorConfig::get('cms')->removeButtons('image') and HtmlEditorConfig::get('cms')->removeButtons('insertimage') but no success (even though it worked fine for several other buttons).

    I have no idea at all how to adress the flash button. It is not mentioned on http://tinymce.moxiecode.com/tryit/full.php .

    Thanks a lot for any Hint

    SF

  • Ben_W
    Avatar
    Community Member
    80 Posts

    Re: Remove Image and Flash Button from TinyMCE Link to this post

    try 'HtmlEditorConfig::get('cms')->removeButtons('ssimage')'

    The following is one that I used for my last project. make sure it is insert in /mysite/_config.php

    HtmlEditorConfig::get('cms')->setButtonsForLine(1, 'bold', 'italic', 'underline', 'strikethrough', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'styleselect', 'separator', 'bullist', 'numlist', 'charmap');
    HtmlEditorConfig::get('cms')->setButtonsForLine(2, 'undo', 'redo', 'separator', 'cut', 'copy', 'paste', 'pastetext', 'pasteword', 'spellchecker', 'separator', 'ssimage', 'ssflash', 'sslink', 'unlink', 'anchor', 'advcode');
    HtmlEditorConfig::get('cms')->setButtonsForLine(3, '');
    HtmlEditorConfig::get('cms')->disablePlugins('table', 'contextmenu');

    in your case, you just nee to remove 'ssimage', and 'ssflash', just take them out from the list

    HtmlEditorConfig::get('cms')->setButtonsForLine(1, 'bold', 'italic', 'underline', 'strikethrough', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'styleselect', 'separator', 'bullist', 'numlist', 'charmap');
    HtmlEditorConfig::get('cms')->setButtonsForLine(2, 'undo', 'redo', 'separator', 'cut', 'copy', 'paste', 'pastetext', 'pasteword', 'spellchecker', 'separator', 'sslink', 'unlink', 'anchor', 'advcode');
    HtmlEditorConfig::get('cms')->setButtonsForLine(3, '');
    HtmlEditorConfig::get('cms')->disablePlugins('table', 'contextmenu');

  • Silverfish
    Avatar
    Community Member
    59 Posts

    Re: Remove Image and Flash Button from TinyMCE Link to this post

    HtmlEditorConfig::get('cms')->removeButtons('ssimage', 'ssflash') did it.

    Thanks a lot!

    SF

  • Silverfish
    Avatar
    Community Member
    59 Posts

    Re: Remove Image and Flash Button from TinyMCE Link to this post

    Hmmmm...

    today, in Silverstripe V. 2.4.6.

    HtmlEditorConfig::get('cms')->removeButtons('ssimage', 'ssflash')

    has no effect any more.
    Neither can I remove the buttons 'anchor' or 'tablecontrols' by this method. Others like 'pasteword' work like expected. All seems pretty strange.
    Does anyone know if there were changes since 2.4.4?

    Regards
    SF

  • Silverfish
    Avatar
    Community Member
    59 Posts

    Re: Remove Image and Flash Button from TinyMCE Link to this post

    Please forgive me for refreshing the last post.
    I did a lot of research and still have no chance to remove image, flash and anchor from tinymce in Silverstripe 2.4.6.
    Anyone any hint?

    THX!

    Regards
    SF

  • g4b0
    Avatar
    Community Member
    6 Posts

    Re: Remove Image and Flash Button from TinyMCE Link to this post

    I'm having the same problem, I can't remove anchor, image and code buttons from the HtmlEditor, neither I can move them into the first line.

    How can we proceed?
    thanks

    g4b0

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