Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Adding custom button to Tiny_MCE

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

Page: 1
Go to End
Author Topic: 1019 Views
  • AndrewMK
    Avatar
    Community Member
    23 Posts

    Adding custom button to Tiny_MCE Link to this post

    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.

  • Sigurd
    Avatar
    Forum Moderator
    628 Posts

    Re: Adding custom button to Tiny_MCE Link to this post

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

  • AndrewMK
    Avatar
    Community Member
    23 Posts

    Re: Adding custom button to Tiny_MCE Link to this post

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

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