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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

Adding custom button to Tiny_MCE

Go to End

3 Posts   1435 Views


Community Member, 23 Posts

19 January 2009 at 12:04pm

I have been reading some previous forum threads about the customising of TinyMCE and basically i have built a custom button for tiny MCE but cannot get it running what so ever.

What i have done so far is :
Created a new class /mysite/code/alternatetoolbar.php this contains a customised buttons function that returns all the buttons AND my custom button.
Edited /cms/code/leftandmain.php changed EditorToolbar function from 'return new HtmlEditorField_Toolbar($this, "EditorToolbar");' TO 'return Object::create('HtmlEditorField_Toolbar', $this, 'EditorToolbar');'
Added 'Object::useCustomClass('HtmlEditorField_Toolbar', 'AlternateToolbar');' to /mysite/_config.php
Added my plugin to the /jsparty/tiny_mce2/plugins directory
Added button image to /jsparty/tiny_mce2/themes/advanced/images

But absolutely nothing appears in the application!!!!

I tried editing the 'HtmlEditorField_Toolbar' and adding the button and whilst this added the button, the button did nothing when pressed!

If anyone can help please let me know.


Forum Moderator, 628 Posts

10 February 2009 at 5:32pm

Which version of SilverStripe are you using? This becomes easier in 2.3 ... :)


Community Member, 23 Posts

11 February 2009 at 8:44am

Using 2.23 I got it working in the end but i had to edit the 'HtmlEditorField_Toolbar' instead of using my own function.