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.

General Questions

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

[Solved] TinyMCE customizing problems


Reply

21 Posts   8502 Views

Avatar
Digital-Punk.co.uk

10 November 2009 at 10:54pm Community Member, 51 Posts

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 :(

Avatar
yurigoul

10 November 2009 at 11:10pm Community Member, 202 Posts

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?

Avatar
Digital-Punk.co.uk

10 November 2009 at 11:41pm Community Member, 51 Posts

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.

Avatar
yurigoul

10 November 2009 at 11:46pm Community Member, 202 Posts

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.

Avatar
Digital-Punk.co.uk

25 November 2009 at 1:24am Community Member, 51 Posts

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 ;)

Avatar
the.dude

17 December 2009 at 1:51am Community Member, 3 Posts

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.

Avatar
yurigoul

17 December 2009 at 2:01am (Last edited: 17 December 2009 2:03am), Community Member, 202 Posts

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

Avatar
Gutur

7 January 2010 at 3:02am (Last edited: 7 January 2010 3:10am), Community Member, 17 Posts

@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