将工具栏移动到TinyMCE Simple主题的顶部

Hon*_*rny 12 tinymce

如何在TinyMCE Simple主题中将工具栏移动到顶部?谢谢

Eri*_*ärd 24


注意:以下说明适用于TinyMCE 3.x. TinyMCE 4.x现已上市,您可能应该使用它.有关更多信息,请参阅http://www.tinymce.com/wiki.php/Configuration.


theme : advanced在TinyMCE中使用时,工具栏只能移动到顶部.没有theme_simple_toolbar_location,但一个theme_advanced_toolbar_location.请参阅http://www.tinymce.com/wiki.php/Configuration3x:theme_advanced_toolbar_location中的文档.

您可以做的是为编辑器提供服务theme : advanced,然后使用theme_advanced_buttons_1_n属性自定义按钮.这里记录了http://www.tinymce.com/wiki.php/Configuration3x:theme_advanced_buttons_1_n.

例:

示例中的代码未经过测试,但应该可以使用.它将显示一个编辑器,顶部有Bold,Italic和Underline按钮.

tinyMCE.init({
  mode : "textareas",
  theme : "advanced",
  theme_advanced_toolbar_location : "top",
  theme_advanced_buttons1 : "bold,italic,underline",
  theme_advanced_buttons2 : "",
  theme_advanced_buttons3 : ""
});
Run Code Online (Sandbox Code Playgroud)

所以答案是:使用时无法移动按钮theme : simple.