Jump to:

23377 Posts in 18296 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » [Solved] TinyMCE customizing problems

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1 2 3
Go to End
Author Topic: 8226 Views
  • Digital-Punk.co.uk
    Avatar
    Community Member
    51 Posts

    Re: [Solved] TinyMCE customizing problems Link to this post

    If you want to remove h2 from your tinymce dropdown, try to delete it from jsparty/tiny_mce2/tiny_mce.js and tiny_mce_src.js or jsparty/tiny_mce2/themes/advanced/editor_template.js and jsparty/tiny_mce2/themes/advanced/editor_template_src.js.

    Of course is not good to change core files, but at the moment there is no another way to do it

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: [Solved] TinyMCE customizing problems Link to this post

    I was afraid of something like that, because it would break during an update

    The thing is, they are third party apps. What is the update policy regarding those apps?

    Is there a way to change your config in such a way that you tell Silverstripe to use another version of one of the third party apps? Is that something that is a desirable feature?

  • Digital-Punk.co.uk
    Avatar
    Community Member
    51 Posts

    Re: [Solved] TinyMCE customizing problems Link to this post

    You can always create your own settings module, where you can add your important core settings. It's takes time, but after you need only to compare some files in your settings module with update files - thats makes updating process more easy.

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: [Solved] TinyMCE customizing problems Link to this post

    Do you have a link to get me started on that? Because it would not only apply to tinymce, but also to other third party js libraries.

  • Digital-Punk.co.uk
    Avatar
    Community Member
    51 Posts

    Re: [Solved] TinyMCE customizing problems Link to this post

    I didn't haven't time yet to publish my settings module. But maybe in the nearest future will be as public module. I think it would be helpful ;)

  • the.dude
    Avatar
    Community Member
    3 Posts

    Re: [Solved] TinyMCE customizing problems Link to this post

    Hey, I had the same problem and I figured out simple solution in PHP-Code (SilverStripe 2.3.3):

    getCMSFields() {
    ...
    HtmlEditorConfig::get('cms')->setOption('theme_advanced_blockformats','media,code,image');
    ..
    }

    This adds <media>, <code> and <image> as formatting option.

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: [Solved] TinyMCE customizing problems Link to this post

    Silverstripe uses its own codes to set certain options. To change the button config, use this in your mysite/_config.php (put in your own options to get the results you want):

    HtmlEditorConfig::get('cms')->setButtonsForLine(1,'bold, italic, bullist, numlist, blockquote, charmap, undo, redo, formatselect');
       
    HtmlEditorConfig::get('cms')->setButtonsForLine(2, 'image, link, unlink, anchor, fullscreen, advcode');

    HtmlEditorConfig::get('cms')->setButtonsForLine(3, 'tablecontrols');

    Check the TinyMCE Wiki for other options

  • Gutur
    Avatar
    Community Member
    17 Posts

    Re: [Solved] TinyMCE customizing problems Link to this post

    @web.take.away: "Of course valid elements depends what you need to add. In my example I added lightbox on the images links."

    You mentioned adding lightbox to TinyMCE, I'm very interested in how you achieved that and can't see anything like that in the code you posted.
    Putting LightBox or FancyBox etc. in the template is quite straightforward and I would love to give editors the possibility to insert a "zoomable" pic within TinyMCE.
    You add "TB_iframe" to the insert-image-dialog but you surely have done some more? Fields in the DB-structure, selection of the "big" picture etc.?
    Can you give some more information on specifically that?

    Cheers /Carsten

    8226 Views
Page: 1 2 3
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.