Remember me? forgot password | register

SilverStripe Forum

4683 Posts in 1048 Topics by 664 members

Jump to:

Extending and hacking

If this is your first visit, you will need to register before you can post. However, you can browse all messages below.

Community » SilverStripe Forum » Extending and hacking » Customize Tiny MCE
Page: 1 , 2 go to end Reply
Author Topic: Customize Tiny MCE 1693 views
  • KingBerT
    KingBerT's avatar
    Community Member
    11 posts

    Customize Tiny MCE Link to this post

    Hello,
    i want to add some buttons to the backend editor "Tiny MCE"?! How can I do that - I tried to edit "tinymce.template.js", but without success.

    Is it impossible to add for example the "select class" drop down menu?!

    so long BerT

  • Sam
    avatar
    Core Development Team
    482 posts

    Re: Customize Tiny MCE Link to this post

    The toolbar spec is defined in sapphire/forms/HtmlEditorField.php - there's a class HtmlEditorField_Toolbar.

  • funkdoobiest
    funkdoobiest's avatar
    Community Member
    8 posts

    Re: Customize Tiny MCE Link to this post

    is it possible to override this class / function without editing core-elements making ugrading harder?

  • Sam
    avatar
    Core Development Team
    482 posts

    Re: Customize Tiny MCE Link to this post

    Yes, you can, but it will require a fair bit of mucking around:

    1) Apply this changeset to your own copy. This will appear in the next version, so you're not distrupting upgradeability.

    http://open.silverstripe.com/changeset/53459/modules/cms/trunk/code/LeftAndMain.php

    2) Create MyToolbar.php. Overload any methods that you need to:

    class MyToolbar extends HtmlEditorField_Toolbar {

    }

    3) Add the following to _config.php:

    Object::useCustomClass("HtmlEditorField_Toolbar", "MyToolbar");

    If someone wants to write a patch that defines methods such as these, that would be handy.

    HtmlEditorField_Toolbar::set_controls($controls);
    HtmlEditorField_Toolbar::add_control($control, $row, $insertBefore = null);
    HtmlEditorField_Toolbar::remove_control($control);

    You would then be able to use these methods to amend the toolbar without creating a new class.

  • sarahk
    avatar
    Community Member
    46 posts
    1 SilverStripe Site

    Re: Customize Tiny MCE Link to this post

    Hi Sam

    So is this in v2.2.2?

  • Sam
    avatar
    Core Development Team
    482 posts

    Re: Customize Tiny MCE Link to this post

    Those last 3 methods don't currently exist, it's a feature suggestion for anyone who wants to implement them.

  • stamate
    stamate's avatar
    Community Member
    6 posts

    Re: Customize Tiny MCE Link to this post

    Hello simple question i just want the font color and background color buttons on tinymce can you give me the lines that I should add to htmleditorfiled.php file please !!! thanks in advance.

  • KingBerT
    KingBerT's avatar
    Community Member
    11 posts

    Re: Customize Tiny MCE Link to this post

    It seems to me, that it does not work anymore in SIlverstripe 2.2.2

    Any ideas, bugfixes?

    1693 views
go to top Reply

Currently Online:

lorem

Welcome to our latest member: lorem