开发者

how to use variables in tinyMCE.init tiny mce?

开发者 https://www.devze.com 2023-01-06 18:49 出处:网络
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 t

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

精彩评论

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

关注公众号