开发者

how to use variables in tinyMCE.init tiny mce?

Can we use variables in tinyMCE.开发者_JS百科init() ? I want to decide the available set of buttons on value of formatselect. Is this possible ?


Yes, this is possible. You only have to make sure that this variables are accessible from the tinymce init function. For example:

var content_file = "/css/content.css";

tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        plugins : "code,...",

        content_css: content_file,  // used here

        language : 'de'
});

You may also use a scriptlanguage liek perl or php to dynamically create your javascript code.


I was able to do what you were asking. Before the init(), but after the <script> be sure to declare the variable

-- var buttonToolBar="bold,italic";

Then, be sure to type the setting correctly

-- theme_advanced_disable: buttonToolBar,

(I noticed that there was no underscore between theme and advanced in your post) This worked for me, and the [Bold] and [Italic] buttons were not visible on my editor.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜