Forum Discussion

peterlu's avatar
peterlu
Champion
12 years ago

tinymce custom plugin

Hi Guys,

 

I am developing a custom plugin for tinymce. The plugin will put a button on the menu bar of tinymce. When you click on the button, it gives you the window to type some text, then you can insert the text into the editor body. Here is the code:

 

tinymce.PluginManager.add('echo', function(editor) {
    // Add a button that opens a window
	editor.addButton('echo', {
		text: 'Echo',
		icon: false,
		onclick: function() {
			// Open window
			editor.windowManager.open({
				title: 'insert your echo',
				body: [
					{type: 'textbox', name: 'echo', label: 'Your echo:'}
				],
				onsubmit: function(e) {
					// Insert content when the window form is submitted
					editor.insertContent('<h1>' + e.data.echo + '</h1>');
				}
			});
		}
	});

	
});

tinymce.init({
    selector: "textarea",
    plugins: "echo",
    toolbar: "echo undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
});

 

 

I have test it in a local html file. It works.

Now the question is: How can I use the Lithium JS object to integration this code into Lithium tinymce. You can normally find this tinymce in new message page or reply page.

  • AdamN's avatar
    AdamN
    Khoros Oracle

    Hi Peter,

     

    In order to add a new TinyMCE plugin to the editor in Lithium, there are a few files that must be updated. Unfortunately, these files are not currently editable via Studio, and must be changed by Lithium. If you'd like to pursue this customization further, I would suggest filing a case so that we can put you in touch with a member of our Professional Services team to better understand your requirements and help you with the next steps.