So here's how I did it:
First define a javascript array BEFORE initialising the TinyMCE editor. This allows you to create this array server side if you want (by writing a response stream declaring it if necessary), or allows you to control it per page. E.g:
var arrUserTags = new Array('{{Name}}','{{Address}}','{{Company}}');
I created a new plugin in tiny_mce/plugins/usertags/editor_plugin.js as follows:
(function() {
tinymce.create('tinymce.plugins.usertags', {
init : function(ed, url) {
},
createControl: function(n, cm) {
switch (n) {
case 'usertags':
var mlb = cm.createListBox('usertags', {
title : 'Insert details ',
onselect : function(v) {
tinyMCE.activeEditor.selection.setContent(v);
}
});
//The array arrUserTags, must be defined before the editor is added!!! Or if you prefer, just ignore the array idea, and just do multiple mlb.add() statements.
for(i=0;i
This you can then register as a plugin in tinymce.