在mt中集成fckeditor的补充说明

以前说过在mt中怎么集成fckeditor。但随着我写得文章越来越长,问题就出现了
首先,以前的集成方法,是在“日记主要”内容中增加了fck,在“更多日记内容中”,并没有出现fckeditor。
而我为了减少页面长度,打算在以后写文章的时候,日记主要内容写摘要,而在更多日记内容中写主要内容。这样就导致了,需要的地方没有fck,而不需要的地方有fck。所以,还需要对集成方式进行一下修改。

这次依然是修改 edit_entry.tmpl这个文件,集成fckeditor到“日记主要内容”,是插入

<head>
<script type="text/javascript" src="你的fck的js代码路径"></script>
<script type="text/javascript">
window.onload = function()
 {
 var oFCKeditor = new FCKeditor( ‘text’ ) ;
  oFCKeditor.Height = "600" ;
  oFCKeditor.Width = "577" ;
  oFCKeditor.ReplaceTextarea() ;
}
    </script>
</head>

注意,下面一行,则是制定fckeditor替代哪一个编辑框。

var oFCKeditor = new FCKeditor( ‘text’ ) ;

在mt中,编辑框一共有2个:

“日记主要内容”对应的是<label for="text">
而“更多日记内容"”对应的是<label for="text_more">
所以,如果想达到我上文提到的目的,即在“更多日记内容”中增加fckeditor。就使用下面的代码:

<head>
<script type="text/javascript" src="http://www.syxin.com/edkcf/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
 {
 var oFCKeditor = new FCKeditor( ‘text_more’ ) ;
  oFCKeditor.Height = "600" ;
  oFCKeditor.Width = "577" ;
  oFCKeditor.ReplaceTextarea() ;
}
    </script>
</head>

注意,这2段代码不能同时出现。

2 thoughts on “在mt中集成fckeditor的补充说明

  1. movabletypecn

    你好,我是通过我的blog上的留言看到你的blog的,http://www.haospoke.com/blog/2006/01/movabletypecncom.html好像我们还是老乡,:(
    因为我也是MT用户,发现并没有人做Movabletype的中文项目,很多时候不了解的东西只能通过google零星搜索到,所以就做了movabletypecn dot com希望能够给喜欢使用MT建站的朋友建站的朋友一些帮助,对MT我还是不了解所以希望能够有更多朋友帮忙指点加入movabletypecn,不知道你有没有兴趣,不管怎样。希望能收到你的email。打搅了!!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *