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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

[Solved] TinyMCE customizing problems


Go to End


21 Posts   13249 Views

Avatar
Digital Punk

Community Member, 51 Posts

10 November 2009 at 10:54pm

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

Community Member, 203 Posts

10 November 2009 at 11:10pm

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

Community Member, 51 Posts

10 November 2009 at 11:41pm

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

Community Member, 203 Posts

10 November 2009 at 11:46pm

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

Community Member, 51 Posts

25 November 2009 at 1:24am

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
pstaender

Community Member, 3 Posts

17 December 2009 at 1:51am

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

Community Member, 203 Posts

17 December 2009 at 2:01am

Edited: 17/12/2009 2:03am

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

Community Member, 17 Posts

7 January 2010 at 3:02am

Edited: 07/01/2010 3:10am

@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