larger smaller normal text version of this page
phplist Development

TinyMCE Support


phplist can use the WYSIWYG editor TinyMCE to spruce up message editing.


Installation


Step 1:
  • Download the TinyMCE archive.
  • Extract to a location of your choice.
  • Copy the subdirectory "tinymce/jscripts/tiny_mce" to the phplist directory "public_html/lists/admin/plugins" on your site.

Step 2:
  • Edit the phplist configuration file (config.php) as needed and upload.

# TinyMCE Support (http://tinymce.moxiecode.com/)
# It is suggested to copy the tinymce/jscripts/tiny_mce directory from the
# standard TinyMCE distribution into the public_html/lists/admin/plugins
# directory in order to keep the install clean.
# Set this to 1 to turn on TinyMCE:
define("USETINYMCE", 1);
# Set this to path of the TinyMCE script, relative to the admin directory:
define("TINYMCEPATH", "plugins/tiny_mce/tiny_mce.js");
# Set this to the language you wish to use for TinyMCE:
define("TINYMCELANG", "en");
# Set this to the theme you wish to use.  Default options are: simple, default and advanced.
define("TINYMCETHEME", "advanced");


Configuration


After installing and enabling TinyMCE, you can further configure the editor by inserting configuration settings in the config.php file:

# Set this to any additional options you wish.  Please be careful with this as you can
# inadvertantly break TinyMCE.  Rever to the TinyMCE documentation for full details.
# Should be in the format: ',option1:"value",option2:"value"'   <--- note comma at beginning
define("TINYMCEOPTS", "");

General Configuration Example
This is an example taken from the forum of setting TinyMCE options:

define("TINYMCEOPTS", ",plugins : '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]'
"
);
Source: Forum post by afeuer


Possible issues with image path
In particular, a common problem is that images with the same base URI as the editor script are inserted using a local address which will only result in a broken URI if emailed. This will not be apparent during editing (which stresses the importance of using test messages before starting a large mailing). This problem is claimed to be a browser issue related to how URI's are submitted via forms (according to the TinyMCE documentation). They suggest the following work around (in config.php ~line 150) which is claimed to "guess" the base URI and try to re-insert it:

define("TINYMCEOPTS", ",relative_urls : false,convert_urls : false");

Another possible work around which illustrates the nature of the problem, is to insert images using a slightly different base URI. For example, if accessing the phplist admin page via EXAMPLE.COM, one could trick tinyMCE (or the browser) into using a complete URI for images just by tacking on WWW, so by using WWW.EXAMPLE.COM, the base is different enough that basepath might not get replaced.


For more info on configuring TinyMCE, see:


CategoryDevelopment
Page was generated in 0.1426 seconds