首页 使用chenpress代替wordpress默认编辑器
文章
取消

使用chenpress代替wordpress默认编辑器

Wordpress默认的编辑器是TinyMCE,是一个轻量级的基于Javascript的WYSIWYG编辑器。但是用惯了高级的RTE后,用TinyMCE感觉还是不爽,而且它的html编辑模式还会将换行自动转换成
,这点几乎不可忍受(不知道能不能disable掉)。最终还是决定用chenpress了。chenpress是一个基于FCKeditor的 wordpress插件,FCKeditor可是大名鼎鼎啊。我找了好久,都没有找到一个理想的下载连接,通过google找到了这里:http://www.pixelficker.com/chenpress-wysiwyg-for-wordpress/,速度比较慢。为了方便,决定在自己这里host一份。

另外,因为最新的chenpress是3.1.1版本,内置的是FCKeditor2.1.1,对于firefox的支持还不是很完善,我又将内置的FCKeditor升级到最新的FCKeditor2.3.2。应该已经完全支持firefox了。

安装和升级chenpress的步骤如下:

1. 下载chenpress(下载连接见下)。(从哪里下都可以~但是我只用3.1.1的版本测试过~)

2. 将chenpress解压到wordpress的plugin目录中(一般是:wp-contentplugins)。将生成一个chenpress目录。

3. 在wordpress的plugin设置页将chenpress plugin激活(activate)。

4. 在users设置页,将Use the visual rich editor when writing勾掉(否则TinyMCE还会出来)。到这步,chenpress已经安装成功了,可以使用了。接下来,升级FCKeditor。

5. 下载FCKeditor2.3.2

6. 解压缩FCKeditor2.3.2.zip,覆盖chenpressFCKeditor目录下所有文件。

7. 修改chenpressFCKeditorfckconfig.js文件,加入这样一段代码:

`FCKConfig.ToolbarSets["WordPressTool"] = [ [’Source’,'-’,'NewPage’,'Templates’,'Preview’,'Print’], [’Cut’,'Copy’,'Paste’,'PasteText’,'PasteWord’], [’Undo’,'Redo’,'-’,'Find’,'Replace’,'SpellCheck’], [’Form’,'Checkbox’,'Radio’,'TextField’,'Textarea’,'Select’,'Button’,'ImageButton’,'HiddenField’], [’Link’,'Unlink’,'Anchor’], [’Image’,'Flash’,'Table’,'Rule’,'Smiley’,'SpecialChar’,'PageBreak’,'UniversalKey’], [’OrderedList’,'UnorderedList’,'Outdent’,'Indent’,'JustifyLeft’,'JustifyCenter’,'JustifyRight’,'JustifyFull’], [’Bold’,'Italic’,'Underline’,'StrikeThrough’,'Subscript’,'Superscript’,'RemoveFormat’], ‘/’, [’Style’,'FontFormat’,'FontName’,'FontSize’], [’TextColor’,'BGColor’], [’About’] ] ;`

8. 在chenpress.php中,找到window.onload这个javascript的function,加入这段代码:

`if (!document.getElementById('content')) { return; }`

9. Goal!

下载连接:

本文由作者按照 CC BY-NC-SA 4.0 进行授权
热门标签

Best of Vim Tips 中文版

linux命令行下载工具

Comments powered by Disqus.

热门标签