[opencms-dev] Add Formats button to tinyMCE editor

Paoletti Corrado c.paoletti at fineco.it
Fri Sep 25 09:55:55 CEST 2015


Hi,
I found the solution:

1) in /system/modules/my.test.module/resources/ create a plain file named whatyouwant.css_style (it is important "_style"). This file contains rules like this

[
	{title: 'Bold text', inline: 'b'},
	{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
	{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
	{title: 'Example 1', inline: 'span', classes: 'example1'},
	{title: 'Example 2', inline: 'span', classes: 'example2'},
	{title: 'Table styles'},
	{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
]

See http://www.tinymce.com/wiki.php/Configuration:style_formats

2) in /system/modules/my.test.module/templates/ assign at template property of template file /system/modules/my.test.module/resources/whatyouwant.css (note: without "_style");

3) in /system/workplace/editors/configuration/ edit "options_all" and "options_extended" and assign true value to option.style;

That's all. Note that /system/workplace/editors/tinymce/editor.jsp is not touched!

Hope this help.

Corrado



-----Original Message-----
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Paul-Inge Flakstad
Sent: giovedì 24 settembre 2015 15:06
To: The OpenCms mailing list
Subject: Re: [opencms-dev] Add Formats button to tinyMCE editor

Hi Paoletti,

I'm no expert, but you should probably do this in /system/workplace/editors/tinymce/editor.jsp

Also, /system/workplace/editors/tinymce/opencms_plugin.jsp has an init function as well (~ line 314).

HTH :)

Cheers,
Paul

-----Original Message-----
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Paoletti Corrado
Sent: 24. september 2015 12:03
To: The OpenCms mailing list
Subject: [opencms-dev] Add Formats button to tinyMCE editor

Hi,
I use OpenCms 9.5.0. What I would like to do is to add the Formats button to tinyMCE editor (4.1.3 version). 

Into tinyMCE site I have found:

http://www.tinymce.com/wiki.php/Configuration:style_formats

so I edited the

/system/workplace/editors/editor.jsp

Adding

style_formats: [
	{title: 'Bold text', inline: 'b'},
	{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
	{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
	{title: 'Example 1', inline: 'span', classes: 'example1'},
	{title: 'Example 2', inline: 'span', classes: 'example2'},
	{title: 'Table styles'},
	{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'} ],

to tinyMCE.init() call.

Formats button doesn't appear. Could someone help me?

Cheers,

--
Corrado
_______________________________________________
This mail is sent to you from the opencms-dev mailing list To change your list options, or to unsubscribe from the list, please visit http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev



_______________________________________________
This mail is sent to you from the opencms-dev mailing list To change your list options, or to unsubscribe from the list, please visit http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev






More information about the opencms-dev mailing list