Posted:September 6, 2006
NOTE: I have posted a major cleanup and update of what is now called the Advanced TinyMCE Editor, tested beginning with WP v. 2.2. Obtain the plug-in download and documentation HERE. The update announcement is now the best place to post new online comments and discussion. Let me know what you think! MKB

Author’s Note: There is a zipped plugin, code and documentation that supports the information in this post, which will allow you to extend the functionality of your TinyMCE rich text editor in WordPress; for immediate instructions see the end of the post below.
Download Extended TinyMCE code file Click here (NOW DISABLED!) to download the zipped file (101 KB)

My most recent post was about the smooth upgrade to WordPress v. 2.0.4 for my blog software and noted my popular Comprehensive Guide to a Professional Blog Site recounting my own experiences setting up, configuring and maintaining my own blog site. A key aspect of that earlier Guide dealt with (what I perceived to be) an oversight in older versions of WordPress that lacked a bundled WYSIWYG editor. For my own site and installation, I had chosen the Xinha editor, and had devoted a number of entries in the Guide to its configuration and use.

However, as of WordPress version 2x, the developers have now chosen to bundle the proven Javascript rich text editor, TinyMCE, as part of the standard distribution package. Since I had come to rue some of the aspects of Xinha in my earlier implementation (namely, bad HTML for carriage returns and VERY slow times when publishing a post), I decided to give TinyMCE a go as my new replacement editor.

(Actually, this was not such a major shift since we had adopted a sibling TinyMCE application, the Joomla Content Editor (JCE), for the Joomla-based BrightPlanet corporate Web site.)

As implemented, the TinyMCE editor in WordPress is configured more akin to the prior QuickTags feature set, with the few available editing functions being bold, underline, bullets, text alignment, and so forth. Here is a screen shot from my WordPress administration center with TinyMCE as delivered with WordPress v. 2.0.4:

The only problem is that I have become used to editing support for items such as tables, image manipulation, special characters, font types, and so forth. While I (generally) edit and clean up the HTML before final posting, I very much enjoy the productivity benefits of a more full-featured WYSIWYG editor. So, the rhetorical question to myself was: If I’m going to use TinyMCE, how can I extend its functionality?

The Investigations Begin

Having been familiar with other TinyMCE instantiations, I began my investigations with the (as it turns out naive) assumption that upgrading to a full featured TinyMCE would be a snap. Boy, was I wrong.

I first began with the TinyMCE Web site itself checking out the standard distribution package. Like many open source sites, I found the online documentation for TinyMCE to be fragmented, incomplete and hard to navigate. I looked under the ‘Plugins’ tab and found it was documentation for developers in creating a new plugin. My first lead came from the online manual (which can also be downladed for local browsing) and its reference to installation options, specifically these options at the bottom of that page:

Bingo! Clearly, TinyMCE had the advanced features I was seeking and they were packaged as part of the direct TinyMCE distribution to boot! Now I assumed my only needed step was to find how to “turn on” these features in my WordPress installation.

What Was Learned
This line of thinking led me to an unfortunate waste of time in Web search and poking through the forums at both the TinyMCE and WordPress sites. It became clear that the TinyMCE integration in WordPress was both highly tailored and limited to just the simple functionality (Example 00 above). I saw references by others to the “wisdom” of the WordPress developers to making this choice and therefore reducing the overall size of the WordPress download, but I don’t see it that way. It seems rather arbitrary and taking available choices from the user by unilaterally “whittling down” a more fully featured option from Moxiecode. Oh, well.

One dead end among many I pursued was instructions from the TinyMCE staff on integrating Moxiecode’s commercial plugins. That reference — http://tinymce.moxiecode.com/downloads/integration/ — got me way too into specific WordPress code that I was also unable to modify for my specific plugin purposes (though perhaps more capable programmers could have seen a clear path). I also found many requests but little guidance from the WordPress forums.

The first breakthough occurred on the TinyMCE Wishlist postings on the WordPress forum, which led me to the Advanced WYSIWYG plugin by Assaf Arkin of Labnotes. Part of the problem in finding this in the first place was that the actual plugin file name was misspelled as “advacned-wysiwyg”. So, I followed the instructions for the plugin and, voila, it didn’t work!

Grr! More investigation indicated that the likely problem resided in new version 2x plugins for TinyMCE as NOT working with the Advanced WYSIWYG plugin. As Paul Finch reported on the Labnotes site, reverting back to earlier advanced plugins for TinyMCE in versions 1.45 and earlier, which could be found on the Sourceforge download site, solved the problem.

As indeed it does, as this updated editor on my blog administration panel shows:

These “standard” advanced plugins for TinyMCE provide possible functionality beyond the simple installation (marked with an asterisk [*]) (also, ones I could not get to work — but I did not test all of them! — are shown with double asterisks [**]) for:

Default buttons available in the advanced theme:

* bold
italic
* underline
* strikethrough
* justifyleft
* justifycenter
* justifyright
* justifyfull
* bullist
* numlist
outdent
* indent
cut
copy
paste
* undo
* redo
* link
* unlink
* image
cleanup
help
* code
hr
removeformat
formatselect
fontselect
fontsizeselect
styleselect
sub
sup
forecolor
backcolor
charmap
visualaid
anchor
newdocument
separator

Plugins with the button name same as plugin name:

save
emotions
flash
iespell
preview
print
zoom
fullscreen
advhr
fullpage
spellchecker

Plugins with custom buttons:

advlink (will override the “link” button)

advimage (will override the “image” button)

paste

  • pastetext
  • pasteword
  • selectall

** searchreplace

  • search
  • replace

insertdatetime

  • insertdate
  • inserttime

table

  • tablecontrols
  • table
  • row_props
  • cell_props
  • delete_col
  • delete_row
  • col_after
  • col_before
  • row_after
  • row_before
  • row_after
  • row_before
  • split_cells
  • merge_cells

directionality

  • ltr
  • rtl

layer

  • moveforward
  • movebackward
  • absolute
  • insertlayer

** style

  • styleprops

Early Use Observations

With one major exception — and it is MAJOR! — I have generally been pleased with the new TinyMCE editor in its full functionality version. I have been working with it for nearly a week and have completed four or five published posts. The writing of posts is now much quicker. There are no longer problems with line breaks and paragraph formatting. For most functionality, the editor just feels more “solid” than my previous Xinha editor. For all of that, I am very thankful.

The major issue I have encountered is with long posts (such as this one), particularly when I am toggling between the code (HTML) view and WYSIWYG view. Without warning, I will suddenly lose entire portions of text at the bottom of the post. This appears to be either strictly a TinyMCE issue or perhaps an issue related to my Firefox browser that others have noted on the WordPress forum.

Best practices, as I have reported on elsewhere and as part of my Guide, generally suggest drafting long posts external to WordPress anyway, though the loss of any work is distressing. I will monitor this “long posting” issue carefully, and until I see a resolution I will likely save to the clipboard or take other steps to prevent future losses.

Specific Upgrade Instructions

So, because I have generally been pleased with these extensions, I thought I would package and write them up for others to use, saving you the fits and starts I went through. The download at the top of this post includes the instructions and all files noted below. The instructions are included as the readme.txt file in the package. I also chose to make some minor updates to plugin operation (better sizing of popups, for example) and also corrected the spelling error in the file name and allowed for multi-line bullets for the extended TinyMCE in the Advanced WYSIWYW plugin. All of these changes, plus the vetted TinyMCE ver. 1.45 advanced plugins, are included in the distribution. Please note this information is being provided “as is”; you can also only do this if you have direct file access to your WordPress installation.

1. Download the enclosed zip file and unzip it to a clean subdirectory; these instructions are repeated in the enclosed readme.txt file.

2. If you don’t like the button order shown in the image above, you may remove buttons or change ordering or add or remove separator bars by editing the advanced-wysiwyg.php file:

< ?php
/*
Plugin Name: Advanced WYSIWYG Editor
Plugin URI: http://www.labnotes.org/
Description: Adds more styling options to the WYSIWYG post editor, updated for multi-line buttons.
Version: 0.3
Author: Assaf Arkin
Author URI: http://labnotes.org/
License: Creative Commons Attribution-ShareAlike
Tags: wordpress tinymce
*/

if (isset($wp_version)) {
add_filter(“mce_plugins”, “extended_editor_mce_plugins”, 0);
add_filter(“mce_buttons”, “extended_editor_mce_buttons”, 0);
add_filter(“mce_buttons_2”, “extended_editor_mce_buttons_2”, 0);
add_filter(“mce_buttons_3”, “extended_editor_mce_buttons_3”, 0);
}


function extended_editor_mce_plugins($plugins) {
array_push($plugins, “table”, “fullscreen”, “searchreplace”, “advhr”, “advimage”);
return $plugins;
}


function extended_editor_mce_buttons($buttons) {
return array(
“undo”, “redo”, “separator”, “cut”, “copy”, “paste”, “separator”, “bold”, “italic”, “underline”, “strikethrough”, “separator”,
“bullist”, “numlist”, “separator”, “indent”, “outdent”, “separator”,
“justifyleft”, “justifycenter”, “justifyright”, “justifyfull”, “separator”,
“sub”, “sup”, “charmap”, “hr”, “advhr”,”separator”, “link”, “unlink”, “anchor”, “separator”,
“code”, “cleanup”, “separator”, “search”, “replace”, “separator”, “wphelp”);
}

function extended_editor_mce_buttons_2($buttons) {
// the second toolbar line
return array(
“formatselect”, “fontselect”, “fontsizeselect”, “styleselect”, “separator”, “forecolor”, “backcolor”, “separator”,”removeformat”);
}

function extended_editor_mce_buttons_3($buttons) {
// These are the buttons for third toolbar line
return array(
“image”, “separator”, “tablecontrols”, “separator”, “fullscreen”, “wordpress”);
}
?>

3. Copy the resulting advanced-wysiwyg.php file into your standard WordPress plugins directory (wp-content\plugins)

4. Copy all files from the extracted plugins subdirectory to the TinyMCE plugins subdirectory in your WordPress directory (wp-includes\js\tinymce\plugins)

5. Under ‘Plugins’ in your WordPress administrative center, ‘activate’ the Advanced WYSIWYG Editor plugin

6. Now, when you write or manage posts or pages you will have the extended TinyMCE functionality available

7. Enjoy!

Posted by AI3's author, Mike Bergman Posted on September 6, 2006 at 2:38 pm in Blogs and Blogging, Open Source, Site-related | Comments (60)
The URI link reference to this post is: https://www.mkbergman.com/275/extending-tinymce-the-wordpress-rich-text-editor/
The URI to trackback this post is: https://www.mkbergman.com/275/extending-tinymce-the-wordpress-rich-text-editor/trackback/
Posted:September 5, 2006

Though version 2 was first released to the public on December 31, 2005, I waited until the bugs-worked-out 2.0.4 version was released on July 29 to actually upgrade my blog’s WordPress software (and, then, late at that!). I thank BrightPlanet‘s most able sys admin, Kevin Klawonn, for doing the actual upgrade. As usual, Kevin, much thanks!

As early readers of this blog know, I have been recounting my blogging and software experiences in a series of posts, now distributed as the popular Comprehensive Guide to a Professional Blog Site. It would thus only be fair to congratulate the WordPress folks for a very smooth upgrade installation. Until last week, I had been using version 1.5.2. Kevin threw the switch on the WordPress 2.0.4 (http://wordpress.org/development/2006/07/wordpress-204/) upgrade last Friday according to the very able instructions in the Detailed Instructions or How to Upgrade in Five Steps.

Like desktop productivity software such as MS Office, I reluctantly and rarely upgrade, and then only to stable versions that have been proven for some time in the marketplace. A six-month time between a major upgrade release such as WordPress 2x and its more stable follow-on is not atypical.

So far, I generally like the new version. (I discuss later the new rich text editor, TinyMCE, and some quirks about how WordPress handled its integration.) I like the posting preview feature and the (apparently better, I haven’t yet pulled the trigger! Yikes, make sure backups exist!) permalinks options. I also like the fact this new version is much cleaner in producing valid XHTML v. 1.0 code.

It truly is amazing the quality of open source software now available, isn’t it? Thanks, WordPress!

Posted by AI3's author, Mike Bergman Posted on September 5, 2006 at 7:50 pm in Open Source, Site-related | Comments (1)
The URI link reference to this post is: https://www.mkbergman.com/278/a-smooth-wordpress-204-upgrade/
The URI to trackback this post is: https://www.mkbergman.com/278/a-smooth-wordpress-204-upgrade/trackback/

The W3C’s ESW semantic Web wiki, which I recently featured for its listing of 70 semantic Web tools, has now added a compilation of semantic Web books and conference proceedings, strictly defined. The listing presently contains about 20 books, mostly from the last two years, and a similar number of book-length conference proceedings. Though the predominance of listings is for English, books are also listed in French, German and Hungarian.

Readers are encouraged to add to this list, which should be a good reference point moving forward. My only question is what Ivan Herman’s definition of ‘strictly’ really means. For example, I think it is notable that Jeffrey Pollock’s and Ralph Hodgson’s Adaptive Information: Improving Business Through Semantic Interoperability, Grid Computing, and Enterprise Integration (ISBN: 0471488542) is not listed. Does ‘semantic Web’ specifically need to occur in the title to be considered?

I will suggest Adaptive Information for the listing when my review of it is complete. Meanwhile — and perhaps for a long time — you way want to check out this W3C listing.

Posted by AI3's author, Mike Bergman Posted on September 5, 2006 at 10:22 am in Adaptive Information, Book Reviews, Semantic Web | Comments (0)
The URI link reference to this post is: https://www.mkbergman.com/276/new-wiki-listing-of-semantic-web-books/
The URI to trackback this post is: https://www.mkbergman.com/276/new-wiki-listing-of-semantic-web-books/trackback/
Posted:August 30, 2006

A Semantic Web Primer, by Grigoris Antoniou and Frank van Harmelen, achieves just what it sets out to achieve:  to be a useful undergraduate introduction to the semantic Web.  This actually has much broader applicability, because, in the words of the authors’:

The question arises whether there is a need for [such an introductory undergraduate] textbook, given that all information is available online. We think there is a need because on the Web there are too many sources of varying quality and too much information. Some information is valid, some outdated, some wrong, and most sources talk about obscure details. Anyone who is a newcomer and wishes to learn something about the Semantic Web, or who wishes to set up a course on the Semantic Web, is faced with these problems. This book is meant to help out.

I obtained the book for that very same purpose, and it does provide a fairly useful basis for self-study for the layperson practitioner.  It also contains exercises at the end of each section making it useful for course teaching.

The book proceeds from a general discussion of the semantic Web and progresses through XML to XML Schema, XPath and XSL and XSLT, then the RDF and RDF Schema frameworks, on to then OWL and predicate logic, applications, example uses and ontologies and possible future developments.  The progression builds in line with Berner-Lee’s "layer" cake diagram (see my earlier post) and explains concepts clearly and well.

But it is a prettly slim volume.  After removal of blank pages, listings of markup code and accounting for wide white space margins, there are perhaps only 110 pages of useful content in the whole volume.

The references at the end of each section are excellent and will be important follow-on reading for serious students.

I think — as an introductory guide and as a quick way to cut through all of the overlapping and confusing resources on the Web — that this hardcover book deserves attention.  But it does not, unfortunately, alone constitute the one-stop introductory resource it could have been.  After reading this, it is time to move on to the more detailed section references.  I actually suspect that it will also be little consulted as a reference source on the shelf.

But, if you have been wanting a pretty good global, easy introduction to the semantic Web, this is probably worth your purchase.  The book can be obtained for about $30 new from Amazon (April 2004, MIT Press, 272 pp.).

Posted by AI3's author, Mike Bergman Posted on August 30, 2006 at 9:14 am in Book Reviews, Semantic Web | Comments (2)
The URI link reference to this post is: https://www.mkbergman.com/271/a-semantic-web-primer/
The URI to trackback this post is: https://www.mkbergman.com/271/a-semantic-web-primer/trackback/
Posted:August 29, 2006


Ian Delaney
, a journalist based in London, reports on an interview he had with John Davies of BT (the former British Telecom) during a Semantic Lunch. I have previously written about Davies’ BT colleague Paul Warren and his call for the need for semi-automation.  This interview is also helpful because Davies makes the related points that semantic Web ideas will first find traction in the enterprise and therefore the term ‘semantic technologies’ is more precise than the global challenges of the semantic Web.  As Delaney summarizes part of Davies’ views in this conversation:

We'll see the first applications of semantic technologies in the enterprise space. Its need is more acute. They have lots of databases, all built by different people according to different rules. Integrating the information from those is already a very costly and time-consuming activity. One database may talk about CustomerName, another may refer to CustomerID, for example. Joining these things together, so perhaps, a support department knows about what equipment the logistics department has installed for a customer, improves business efficiency. Semantic technologies put what Davies called a "wrapper" around these different data sources to create overarching access, connecting different datasources in a way that doesn't require nearly so much human effort.

I agree totally with the evolutionary, incremental view of semantic Web adoption beginning in the enterprise as an earlier posting argued, with its initial role being to help overcome semantic heterogeneities.  I may also begin to work in the phrase ‘semantic technologies’ more into my writings.

Posted by AI3's author, Mike Bergman Posted on August 29, 2006 at 9:19 am in Semantic Web | Comments (0)
The URI link reference to this post is: https://www.mkbergman.com/270/semantic-technologies-in-the-enterprise/
The URI to trackback this post is: https://www.mkbergman.com/270/semantic-technologies-in-the-enterprise/trackback/