[contrib] Adding options to TinyMCE with TINYMCEOPTS

3rd party code for pl

Moderators: Dragonrider, J_S, Hernol, vancoovur, H2B2, Heritage

[contrib] Adding options to TinyMCE with TINYMCEOPTS

Postby afeuer » 8:01am, Mon 13 Nov, 2006

tinyMCE editor is more stable than the FCK. It is best when you can use most of tinyMCE options.

To add all the options use the below "TINYMCEOPTS" located in the "config.php" file (after enabling tinyMCE).

*************

define "TINYMCEOPTS", ",plugins : 'devkit,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras', theme_advanced_buttons1_add_before : 'save,separator',
theme_advanced_buttons1_add : 'fontselect,fontsizeselect',
theme_advanced_buttons2_add : 'separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor',
theme_advanced_buttons2_add_before: 'cut,copy,paste,separator,search,replace,separator',
theme_advanced_buttons3_add_before : 'tablecontrols,separator',
theme_advanced_buttons3_add : 'emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen',
theme_advanced_toolbar_location : 'top',
theme_advanced_toolbar_align : 'left',
theme_advanced_path_location : 'bottom',
plugin_insertdate_dateFormat : '%m-%d-%Y',
plugin_insertdate_timeFormat : '%H:%M:%S',
extended_valid_elements : 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'
");
afeuer
phplister
 
Posts: 5
Joined: 12:47am, Thu 22 Dec, 2005

Postby H2B2 » 12:38am, Tue 14 Nov, 2006

Thanks for sharing!

I have added this to the tinyMCE documentation page. As you use tinyMCE you might want to review that page, and change it or add paragraphs if necessary.
H2B2
phpList Guru
 
Posts: 5890
Joined: 1:51am, Wed 15 Mar, 2006

Postby afeuer » 7:24pm, Tue 14 Nov, 2006

I found out that with above optione tinymce uses only relative links and not absolute links (it truncate the http:\\).

To over come this issue oleas add the folloing to optins:

relative_urls : 'false' ,
remove_script_host : 'false' ,

The full text for "TINYMCEOPTS" become:

define("TINYMCEOPTS", ",plugins : 'devkit,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras',
theme_advanced_buttons1_add_before : 'save,separator',
theme_advanced_buttons1_add : 'fontselect,fontsizeselect',
theme_advanced_buttons2_add : 'separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor',
theme_advanced_buttons2_add_before: 'cut,copy,paste,separator,search,replace,separator',
theme_advanced_buttons3_add_before : 'tablecontrols,separator',
theme_advanced_buttons3_add : 'emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen', theme_advanced_toolbar_location : 'top',
theme_advanced_toolbar_align : 'left',
theme_advanced_path_location : 'bottom',
plugin_insertdate_dateFormat : '%m-%d-%Y',
plugin_insertdate_timeFormat : '%H:%M:%S',
relative_urls : 'false' ,
remove_script_host : 'false' ,
extended_valid_elements : 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'
");
afeuer
phplister
 
Posts: 5
Joined: 12:47am, Thu 22 Dec, 2005

Postby H2B2 » 1:49am, Wed 15 Nov, 2006

afeuer wrote:I found out that with above optione tinymce uses only relative links and not absolute links (it truncate the http:\\).
OK, I updated the docs.
H2B2
phpList Guru
 
Posts: 5890
Joined: 1:51am, Wed 15 Mar, 2006

Postby nymisoa » 4:46pm, Sun 25 Feb, 2007

If you make a minor change as so:
Code: Select all
theme_advanced_buttons3_add : 'pastetext,pasteword,selectall,emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen',
This adds the nice Paste From Word and Paste as Text buttons. Helpful if you draft messages in another application and just want to bring the text over without the underlying code. The code from copying from Microsoft Word will likely break any CSS your using.

These buttons are enabled in the 'paste' plugin.




afeuer wrote:relative_urls : 'false' ,
remove_script_host : 'false' ,
Not sure if it's just my installation, but I have to remove the quotes around the above two to get them to work:
Code: Select all
relative_urls : false ,
remove_script_host : false ,



YMMV
nymisoa
PL Nut
 
Posts: 22
Joined: 2:39pm, Thu 07 Dec, 2006

Postby nymisoa » 5:27pm, Fri 14 Mar, 2008

I don't remember writing this but you do have to remove the quotes when you pass booleans to the TinyMCE config.

The new 3.x version of TinyMCE is particularly finicky if you don't.
nymisoa
PL Nut
 
Posts: 22
Joined: 2:39pm, Thu 07 Dec, 2006

Postby avibodha » 6:42pm, Fri 28 Mar, 2008

I'd also recommend removing the 'save' plugin and button. They don't save the currently edited message and could confuse users.

I had to remove it after users complained they thought they had saved their message - but it didn't.
avibodha
phplister
 
Posts: 9
Joined: 4:13pm, Wed 12 Oct, 2005

Re: [contrib] Adding options to TinyMCE with TINYMCEOPTS

Postby bradley » 2:24am, Sat 22 Aug, 2009

I found out that with above options, tinymce does allow for image alignment. I added: style (after 'alt' and before 'title')
to the img tag, and now alignment seems to be working.

Code: Select all
extended_valid_elements : 'a[name|href|target|title|onclick],img[class|src|border=0|alt|style|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'


I got the tip from the tinymce forum:
tinymce.moxiecode.com/punbb/viewtopic.php?id=12326
bradley
phplist newbie
 
Posts: 1
Joined: 2:16am, Sat 22 Aug, 2009


Return to Add-ons, Contributions, Mods, Plug-ins

Who is online

Users browsing this forum: No registered users and 0 guests