tinymce2

NP_TinyMCE2

This plugin has been deprecated in favor of NP_TinyMCE which is better maintained and has a fuller set of options. See here.

This plugin integrates TinyMCE (a WYSIWYG XHTML 1.0 editor) into Nucleus CMS. Supported browsers are Mozilla, MSIE and FireFox (Safari experimental).

General Plugin info
Author: karma, roel, eph, kg
Current Version: v1.3
Download: NP_TinyMCE_v13.zip 533KB (package with all needed files)
Code: np_tinymec2_code
Demo: -
Forum Thread: here

Package

The zip file includes all necessary files:

  • NP_TinyMCE2.php (the Nucleus Plugin)
  • TinyMCE version 2.1.1.1 (the WYSIWYG editor)
  • TinyMCE compressor 1.1.0 (for optional compression)

Installing

  1. Unzip the file and upload the contents to your plugin directory
  2. Install the plugin in the Nucleus Plugin Manager
  3. TinyMCE is enabled by default

How to use the plugin

  • Bold, Italic, Underline, Strikethrough, Text color, Background color
  • Align: left, center, right, full
  • Unordered list, Ordered list
  • Outdent, Indent
  • Undo, Redo
  • Edit HTML source
  • Link, Unlink, Image, Media (not in the screenshot)
  • Emoticons, custom characters
  • Paste as plain text, Paste from Word

In the image popup dialog is a little button with which you can call the Nucleus Media Manager.

The second button bar offers additional features (plugin version 1.2). It can be switched on and off in the member options: :tinymce2_features2.png

  • Font family, Font size
  • Subscript, Superscript
  • Insert a new table
  • Table row properties, Table cell properties
  • Insert row before, Insert row after, Delete row
  • Insert column before, Insert column after, Delete column
  • Split table cells, Merge table cells
  • Toggle guidelines, invisible elements
  • Horizontale rule

Available SkinVars and/or TemplateVars

Not necessary.

Options

  • Member option: ‘Use TinyMCE WYSIWYG editor’ (default:’yes’)

Every member of a blog can decide if he want to use the TinyMCE WYSIWYG editor. You can also use this option to edit your old articles without TinyMCE.

  • Member option: ‘Use second button bar with advancded features’ (default:’yes’)

This option allows members to switch the second button bar on or off. It can be used to save space on the screen and to speed up the editor load if the the advanced features in the second button bar are not needed.

  • Plugin option: ‘Extended valid elements that are allowed in TinyMCE’ (default:’object[*],param[*],embed[*]’)

These elements are necessary to post a video. The code for the video can be inserted in the HTML window. TinyMCE doesn’t shows a preview of the video but leave the code in the posting so that the video will be shown when the item is published.

  • Plugin option: ‘Use TinyMCE GZip compression (experimental)’ (default:’no’)

The compression of the editor code should speed up the editor load. But it don’t work in any case, it depends on the used browsers and the network configuration (e.g. firewall). You can use this option if your members work in a defined environment.

Upgrade

Upgrade from version 1.0 to 1.1

Because version 1.0 has a mistake in the javascript code it doesn’t work with the Internet Explorer. Version 1.1 fixes this bug. You can upgrade without downloading the full package:

  1. Download NP_TinyMCE2_v11_code.zip (4 KB)
  2. extract the zip archive
  3. rename the old file NP_TinyMCE.php in you plugin directory to (e.g.) _NP_TinyMCE.php (to make sure that you have a copy)
  4. copy the new file to your plugin directory

Now the plugin should also work with IE.

Upgrade from version 1.0 and 1.1 to 1.2

Because version 1.2 has a new member option it must be installed with the Nucleus Plugin Manager:

  1. Download NP_TinyMCE2_v12_code.zip (4 KB)
  2. extract the zip archive
  3. uninstall the old plugin in the Plugin Manager
  4. rename the old file NP_TinyMCE.php in you plugin directory to (e.g.) _NP_TinyMCE.php (to make sure that you have a copy)
  5. copy the new file to your plugin directory
  6. install the new plugin version in the Plugin Manager

Upgrade from version 1.2 and 1.3

Because version 1.3 has no new plugin options, you can update from version 1.2 to 1.3 easily:

  • Download and unzip the files for version 1.3
  • Backup the files of version 1.2
  • Delete the files of version 1.2
  • Upload the new files in your plugin directory

Uninstall

Please use the Plugin Manager to uninstall this plugin. The plugin has a uninstall routine which recovers the Nucleus javascript toolbar.

Additional information

TinyMCE

The Plugin integrates TinyMCE into Nucleus CMS. TinyMCE is a large, sophisticated javascript application that makes WYSIWYG editing in a browser possible. If you need depper information about it you can read the TinyMCE documentation or visit the TinyMCE forum.

Convert line breaks issue

Normally you have not to care about this issue but for advanced users it is helpfull to know how the plugin handle the line breaks:

Every Nucleus blog have the setting “Convert line breaks”. By default it is switched on. Every line break is automatically converted to a <br /> tag.

TinyMCE is designed to work without this feature. Because its support for this feature is insufficient bad the plugin doesn’t use it. The NP_TinyMCE plugin bypass this option by removing and adding breaks if the blog setting “Convert line breaks” is switched on.

If you have old articles that are written with “Convert line breaks” they might get another formatting if you update them with TinyMCE. To avoid this you can also edit them without TinyMCE (simply switch off in your member settings).

If you start a new blog it can be a good idea two switch “Convert line breaks” off. TinyMCE and your blog working in the same mode. If you don’t work with TinyMCE you have to add <p> or <br /> tags to you articles.

Please be careful if you change the “Convert line breaks” setting in your blogsettings and make a database backup before.

Tips and Tricks

Add New Buttons

Certain functions of the editor is not enabled by default. You can enable the function and add new buttons to increase the functionality of your editor.

TinyMCE Editor’s extra plugins can be download here

For a complete list of the plugin reference, look here

A. Enable Plugins

We are going to use an example here. Let’s add a Flash button :flashbtn.gif, which is commonly required for the embeding of flash video (EG: YouTube) into your blog.

  • Open NP_TinyMCE2.php file
  • Locate this line of code:
      tinyMCE.init({ 
    
  • 3 lines below the above code, there is:
      if ($this->getMemberOption($this->memberid, 'use_advanced')=='yes'){
			$editorCode .=',table,advhr';
		} 
      
  • Change this code to:
      if ($this->getMemberOption($this->memberid, 'use_advanced')=='yes'){
			$editorCode .=',table,advhr,flash';
		}
      
  • This will enable the plugin.

B. Add the Flash Button

  • Open the same file (NP_TinyMCE2.php)
  • Locate the same line of code:
      tinyMCE.init({ 
     
  • About 8 lines of code below, locate:
      theme_advanced_buttons1_add :
    
  • This line contains all additional buttons. To add the flash button, just add “flash” to the code like so:
theme_advanced_buttons1_add : "emotions,charmap,separator,pastetext,pasteword,flash",';
  • Save and upload the file. Your new flash button should appear and ready to use. You must enable Advance Editing in the member’s settings to see and use the flash button.

Wishlist

Bugs

History

Versions:

  • 1.30, 2007-05-18 kg (Kai Greve - http://kgblog.de)
  • 1.20, 2006-07-29 kg
  • 1.10, 2006-06-29 kg
  • 1.00, 2006-06-23 kg
  • 0.91, 2006-06-14 kg
  • 0.9c, 2005-09-28 eph
  • 0.9b, 2005-09-24 eph
  • 0.9, 2005-07-16 roel

Refer the code for a detailed changelog.

Plugin review

NP_TinyMCE2 version 1.3 works with Nucleus CMS version 3.31 - 2008-01-03 kg

 
tinymce2.txt · Last modified: 2009/10/20 16:29 by ftruscot