Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Removing the Edit HTML Source button from TinyMCE


Go to End


4 Posts   3507 Views

Avatar
doubleedesign

Community Member, 19 Posts

23 February 2011 at 11:38pm

Hi all,

I want to remove the Edit HTML Source button from the CMS before I hand it over to a client (don't particularly want them pasting in random bits and pieces and things like that).

I've tried HtmlEditorConfig::get('cms')->removeButtons('advcode'); as per http://archive.ssbits.com/customising-the-wysywig-editor-in-v2-3-2-tinymce/ but the button doesn't disappear from the editor. Am I missing something? Any tips on the best way to customise TinyMCE this way?

Thanks in advance to anyone who can help.

Avatar
swaiba

Forum Moderator, 1899 Posts

24 February 2011 at 12:30am

Just to let you know this worked fine for me (2.4.x) - but it didn't seem to at first, but after placing a debug point to see what was going on - it started working - strange. As a last, last, last resort you could just remove the 'advcode' from the code that intialises it (and also teh cms/_config.php that removes/adds it)

Avatar
Invader_Zim

Community Member, 141 Posts

24 February 2011 at 12:33am

Hi.

Well, your code works perfectly for me. (using SS.2.4.5)
Is it in your mysite/_config.php? Sure there are no typos?

Cheers
Christian

Avatar
doubleedesign

Community Member, 19 Posts

26 February 2011 at 11:33pm

Thank you for the replies ... definitely no typos, the line in my original post was directy copied and pasted :(

swaiba, how did you place the debug point? Perhaps I could try that.