开发者

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

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 d开发者_StackOverflow社区o this?


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.


The exact mode is usefull but don't workout in this case and others.

I'm trying to show 2 editors one in Portuguese and other in spanish (I tried fist in Engish but i'm not sure of the language code) and the interface shows only with the last language (last tinymce.init)

tinymce.init({
mode : "exact",
elements : "area1",
language : 'es',
add_unload_trigger : false,
plugins : 'wordcount',
maxCharacters : 130 // this is a default value which can get modified later,
});

tinymce.init({
mode : "exact",
elements : "area2",
language : 'pt_PT',
add_unload_trigger : false,
plugins : "wordcount table",
maxCharacters : 50 // this is a default value which can get modified later,
});

I'll try some possible solutions and edit my answer today.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜