TinyMCE Keyword plugin

Warning: This blogpost has been posted over two years ago. That is a long time in development-world! The story here may not be relevant, complete or secure. Code might not be complete or obsoleted, and even my current vision might have (completely) changed on the subject. So please do read further, but use it with caution.
Posted on 27 Dec 2009
Tagged with: [ keyword ]  [ opensource ]  [ plugin ]  [ TinyMCE

TinyMCE is truly a remarkable editor. It’s the one I’m typing in now.. it’s the one we use for letting our e-commerce customers use for editing pages and it’s the one we use in our SiteManager5 CMS. You receive a fully down-gradable wysiwyg javascript editor which for non-technical users is very intuitive and thus easy to use and the best part: it’s completely customizable through their plugin-system.

One of those plug-ins is created and maintained by me, namely the Keyword plugin. It’s more or less a simple dropdown selectbox where it inserts the value of the option chosen. It’s main use is for instance for adding large pieces of text (like templates) or an easy way to let the user add keywords from your own template system.

In the latest 1.3 version I have incorporated a patch from Louis Clotman which let you use a configurable key/value separator (in case you need to use the ‘=’ character in your keyword list. Thanks for the patch)

Usage:

  • Copy the files from the zip-file into the plugins/keyword directory.
  • If you need a different language than english or dutch, create it in the keyword/langs directory (it’s just 1 sentence).
  • Add the plugin to your tinyMCE.init: *theme_advanced_buttons1_add : "keyword"
  • Make sure you use the advanced theme (otherwise the button won’t show up)
  • Add the keyword list to your tinyMCE.init: plugin_keyword_list : "<keyword1>=<data1>;<keyword2>=<data2>..."
  • Use the additional plugin_keyword_operator to change the key/value separator: plugin_keyword_operator : "|"

You can add optgroups (more or less) to your selectbox by adding the name of the group before the keyword and separate by a ~. For instance: plugin_keyword_list : "group 1~key1=val1&key2=val2&group 2~key3=val3"