从OpenCms7.5.1开始,系统升级FCKeditor至2.6.5版本,之前版本编辑器的扩展方法详见:http://blog.csdn.net/qianxuncms/archive/2008/01/20/2055259.aspx
但在7.5.1后,configwidget.js的文件已经发生变化,调用和配置方式不同于以前,原来添加字体、字号的方式已经不适用了,解决方法如下:
注释掉原文件中如下内容:
FCKConfig.ToolbarSets["OpenCmsWidget"] = [
<%= option.getButtonBar(CmsFCKEditorWidget.BUTTON_TRANSLATION_MAP, ",") %>
];
<%= option.getButtonBar(CmsFCKEditorWidget.BUTTON_TRANSLATION_MAP, ",") %>
];
替换为:
FCKConfig.ToolbarSets["OpenCmsWidget"] = [
['Source'],
['Style','FontFormat','FontName','FontSize','TextColor','BGColor','FitWindow','Undo','Redo','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Find','Replace','-','SelectAll','RemoveFormat','Cut','Copy','Paste','PasteText','PasteWord'],
['Table','Rule','SpecialChar','-'],
['Print','SpellCheck','Bold','Italic','Underline','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Link','Unlink','Anchor']];
['Source'],
['Style','FontFormat','FontName','FontSize','TextColor','BGColor','FitWindow','Undo','Redo','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Find','Replace','-','SelectAll','RemoveFormat','Cut','Copy','Paste','PasteText','PasteWord'],
['Table','Rule','SpecialChar','-'],
['Print','SpellCheck','Bold','Italic','Underline','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Link','Unlink','Anchor']];
扩展后效果如下图:

图1(OpenCms7.5.2Widget 编辑器扩展后效果图)
本操作在7.5.2中测试成功,如有问题在留言中回复,谢谢。
【版权声明】:凡署名“袁海明”的文章皆为本人原创,交流和联系平台是OpenCms中文网(www.opencmschina.com),敬请注意。本声明亦为文章内容的一部分,不得擅自修改。如若转载本人作品,必须保留作者、链接及本声明!谢谢合作!




匿名 - 2010年08月24日 @ 5:14 下午
a
匿名 - 2010年08月18日 @ 2:28 下午
匿名 - 2010年08月18日 @ 2:27 下午
不用修改 configwidget.js 也可以,只要在opencms-vfs.xml 里定义CmsHtmlWidget的configuration。
例如: