ブロックをアドバンストエディタで編集する
提供: GeeklogJpWiki
ブロックをノーマルモードで編集する場合,通常,HTMLを記述しなければなりません。 これをアドバンストエディタ(FCKeditor)を利用して編集するハックです。
- 本家掲示板より
なお、TinyMCEプラグインを利用するとデフォルトでブロックをアドバンストエディタで編集できますので、以下の作業は不要です。TinyMCEプラグインをダウンロードして活用してください。
public_html/layout/{professional}/admin/block/の"blockeditor.thtml"を次のように編集します。
まず,先頭に次のコードを追加します。
<script type="text/javascript">
// Setup editor path for FCKeditor JS Functions
geeklogEditorBasePath = "{site_url}/fckeditor/" ;
window.onload = function() {
var oFCKeditor1 = new FCKeditor( 'content' ) ;
oFCKeditor1.Config['CustomConfigurationsPath'] = geeklogEditorBaseUrl + '/fckeditor/myconfig.js';
oFCKeditor1.BasePath = geeklogEditorBasePath;
oFCKeditor1.ToolbarSet = 'editor-toolbar2';
oFCKeditor1.Height = 200 ;
oFCKeditor1.ReplaceTextarea() ;
}
</script>
追加したコードの次のコードの中の'content'に注目してください。
var oFCKeditor1 = new FCKeditor( 'content' ) ;
テンプレートファイル中に,
<td><textarea name="content" rows="12" style="width:100%;">{block_content}</textarea><br>
という行がありますが,このtextareaの属性に,id="content"を次のように追加します。
<td><textarea id="content" name="content" rows="12" style="width:100%;">{block_content}</textarea><br>