Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TinyMCE - How can I have 2 editors on the same page with different plugins loaded?

Tags:

tinymce

I have a page that has multiple TinyMCE editors on it. i would like one of them to have the autoresize plugin loaded and the other one i would like to stay a fixed size.

Is there any way to do this?

like image 764
Justin808 Avatar asked Feb 03 '11 19:02

Justin808


People also ask

How do you add a custom plugin to TinyMCE?

Custom plugins can be added to a TinyMCE instance by either: Using external_plugins : Use the external_plugins option to specify the URL-based location of the entry point file for the plugin.

Do I need an API key for TinyMCE?

Get an API key To start, you'll need your API key and dev environment ready to go. If you haven't signed up for Tiny Cloud, you can do that now — it's easy. Integration quickstart guides are available during the setup.

What is TinyMCE selector?

Selector engine, enables you to select controls by using CSS like expressions.


1 Answers

You can, by simply instantiating the editors with different configurations.

For example, say you have two textareas (area1, area2). Instead of using

tinymce.init({
mode : "textareas",
...
});

which will load tinyMCE in for both textareas on the page, you can instead use

tinymce.init({
mode : "exact",
elements :"area1",
....
});

tinymce.init({
mode : "exact",
elements :"area2",
....
});

with different plugins in each config.

like image 165
Brett Henderson Avatar answered Dec 01 '22 15:12

Brett Henderson