I’m trying to add an option to the TinyMCE ContextMenu plugin and I have somewhat succeded. What I’m trying to do is that once clicked I would like a predetermined text snippet to be added to the editor. This is what I have so far:
t._menu = m;
am = m.addMenu({title : 'Message Personalizer'});
am.add({title : 'First Name', cmd : '**cmd**'});
am.add({title : 'Last Name', cmd : '**cmd**'});
am.add({title : 'Email Address', cmd : '**cmd**'});
am.add({title : 'Cell Phone', cmd : '**cmd**'});
This shows the menu correctly but I haven’t been able to find any documentation that will let me use the command mceInsertContent on it. I normally can call mceInsertContent using tinymce().execCommand('mceInsertContent',false,**mycontent**); and it works without an issue. How would I go about doing this?
You’ll need to register a command: