古いconcrete5の記事でTinyMCEのテンプレートの追加方法というものを見つけました。
記事:
http://sharedhat.com/blog/1178/
5.6.3.2のバージョンを使って作成中なのですが、
TinyMCEのテンプレート機能を使用したいのですが、
テンプレートのボタン追加まではいけましたが、テンプレートの読み込みができません。
使用中のバージョンではできないのでしょうか。
「template_list.js」「some-template1.html」のファイルも下記に格納してあり、記述も問題ないと思います。
◆template_list.js
階層:/js/tiny_mce/lists/template_list.js
======================
var baseTemplatePath = "/js/tiny_mce/";
var tinyMCETemplateList = [
["テンプレート1", baseTemplatePath + "templates/some-template1.html", "テンプレート1です。"],
["テンプレート2", baseTemplatePath + "templates/some-template2.html", "テンプレート2です。"]
];
======================
◆some-template1.html
階層:/js/tiny_mce/templates/some-template1.html
======================
<div class="mceTmpl">
<div class="hd">
<h3>some title</h3>
</div>
<div class="bd">
<p>some contents</p>
</div>
</div>
======================
◆記事ブロックエディター設定
======================
theme : "concrete",
plugins: "inlinepopups,spellchecker,safari,advlink,template",
editor_selector : "ccm-advanced-editor",
spellchecker_languages : "+English=en",
theme_concrete_buttons1 : "undo,redo,pastetext,pasteword,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect",
theme_concrete_buttons2 : "formatselect,bullist,numlist,|,outdent,indent,|,hr,charmap,|,forecolor,backcolor,|,link,unlink,anchor,template",
theme_concrete_buttons3 : "image,cleanup,code",
theme_concrete_blockformats : "p,address,pre,h1,h2,h3,div,blockquote,cite",
theme_concrete_toolbar_align : "left",
theme_concrete_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
theme_concrete_font_sizes : "1,2,3,4,5,6,7",
theme_concrete_styles: "Note=ccm-note",
spellchecker_languages : "+English=en"
template_external_list_url: "/js/tiny_mce/lists/template_list.js",
template_cdate_classes : "cdate creationdate",
template_mdate_classes : "mdate modifieddate",
template_selected_content_classes : "selcontent",
template_cdate_format : "%m/%d/%Y : %H:%M:%S",
template_mdate_format : "%m/%d/%Y : %H:%M:%S"
/*
// Use the advanced theme for more than two rows of content
plugins: "inlinepopups,spellchecker,safari,advlink,table,advhr,xhtmlxtras,emotions,insertdatetime,paste,visualchars,nonbreaking,pagebreak,style",
editor_selector : "ccm-advanced-editor",
theme : "advanced",
theme_advanced_buttons1 : "cut,copy,paste,pastetext,pasteword,|,undo,redo,|,styleselect,formatselect,fontsizeselect,fontselect",
theme_advanced_buttons2 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink,anchor,|,forecolor,backcolor,|,image,charmap,emotions",
theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
// etc.
*/
======================
お助け下さい。
Posted on 3月 14, 2015 at 12:04 午前
|