Following code will make all tags of textareas editable with TinyMCE.

Add following code to MT /tmpl/cms/header.tmpl

<!-- added by alex on 2006-02-12 -->
<script language="javascript" type="text/javascript" xsrc="/ref/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
    //mode : "textareas"
    mode : "exact",
    elements : "text,text_more",
    theme : "advanced",
    //plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
    plugins : "table,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
    //theme_advanced_buttons1_add_before : "save,separator",
    theme_advanced_buttons1_add : "fontselect,fontsizeselect",
    theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
    theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
    theme_advanced_buttons3_add_before : "tablecontrols,separator",
    theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_path_location : "bottom",
    plugin_insertdate_dateFormat : "%Y-%m-%d",
    plugin_insertdate_timeFormat : "%H:%M:%S",
    extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
    external_link_list_url : "example_data/example_link_list.js",
    external_image_list_url : "example_data/example_image_list.js",
    flash_external_list_url : "example_data/example_flash_list.js"
    //content_css : "/styles-site.css"
});
</script>
<!-- added end -->

Edit /tmpl/cms/edit_entry.tmpl, to modify the value of the attribute ROWS for tag TEXTAREA which are defined as following id.

  • id="text"
  • id="text_more"

I don't want to the textareas of templates to be editable with TinyMCE, so I change code to following. 

/tmpl/cms/header.tmpl

<!-- added by alex on 2006-02-12
     modified by alex on 2006-03-01 -->
<script language="javascript" type="text/javascript" xsrc="/ref/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
    mode : "textareas",
    //mode : "exact",
    //elements : "text,text_more",
    editor_selector : "mceEditor",
    theme : "advanced",
    //plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
    plugins : "table,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
    //theme_advanced_buttons1_add_before : "save,separator",
    theme_advanced_buttons1_add : "fontselect,fontsizeselect",
    theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
    theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
    theme_advanced_buttons3_add_before : "tablecontrols,separator",
    theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_path_location : "bottom",
    plugin_insertdate_dateFormat : "%Y-%m-%d",
    plugin_insertdate_timeFormat : "%H:%M:%S",
    extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
    external_link_list_url : "example_data/example_link_list.js",
    external_image_list_url : "example_data/example_image_list.js",
    flash_external_list_url : "example_data/example_flash_list.js"
    content_css : "/css/screen.css"
});
</script>
<!-- added end -->

content_css : "/css/screen.css" tells TinyMCE to use my own css file to display the content of the editable TEXTAREA.

Edit /tmpl/cms/edit_entry.tmpl.

class="full-width mceEditor" name="text" id="text"
class="full-width mceEditor" name="text_more" id="text_more" 

Post a comment

mail.png


相似文章|Related Entries

最近更新|Recent Entries

不定期更新|Handy Entries

相似标签|Related Tags

MT
css (3)
Editlet (5)
EnhancedEntryEditing (2)
export (1)
feed (1)
import (2)
Javascript (5)
msn spaces (2)
MySQL (3)
Password (2)
plugin (7)
refine (2)
rss (2)
Tag (2)
TinyMCE (4)
upgrade (4)
widget (1)
wysiwyg (6)
模板 (2)
重构 (1)
TinyMCE
EnhancedEntryEditing (2)
MT (22)
upgrade (4)
wysiwyg (6)

分类栏目|Categories

按月归档|By Month

2008
11
10
07
05
04
03
02
01
2007
12
10
07
06
05
04
03
02
01
2006
12
11
10
09
08
07
06
05
04
03
02
01
2005
11
10
09
08
07
04
03
2004
12
11
10
09
08
07
06
05
04
03
02
01
2003
12
10
09
08
06
2002
09
08
04
03
02
2001
12
09
07
06
05

站内链接|Site Links

Powered by
Movable Type 3.34