Re: 記事エディターのオフィスモードにh4以降の段落を選択できるようにしたいです

2014年10月22日 at 10:13

やり方は2つあります。まずは簡単なほうから…

【1】
記事ブロックエディター設定で「カスタム」を選びます。
theme_concrete_blockformats : "p,address,pre,h1,h2,h3,div,blockquote,cite",
の行に、h4,h5などと追記してください。h3の後が良いでしょう。

【2】「詳細」や「オフィス」で見出し4以降を使いたい。
→coreファイルをオーバーライドします。
1.
(c5_root)/concrete/helpers/tinymce.php

(c5_root)/helpers/
にコピー(複製)します。

2.
(c5_root)/concrete/core/helpers/tinymce.php
を開き、5行目から135行目をクリップボードにコピーします

3.
先ほど複製した
(c5_root)/helpers/tinymce.php
を開き、

class TinymceHelper extends Concrete5_Helper_Tinymce {}

の{}の中に、クリップボードの内容をペーストします。

4.
ペーストした内容のうち、80行目あたりから

case 'OFFICE':
$textEditorOptions = array_merge($textEditorOptions, array(
'spellchecker_languages' => '+English=en',
'theme' => 'advanced',
'plugins' => 'safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras', //,template,imagemanager,filemanager
'theme_advanced_buttons1' => 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,undo,redo,|,styleselect,formatselect,fontselect,fontsizeselect,', //save,newdocument,help,|
'theme_advanced_buttons2' => 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink,anchor,image,cleanup,code,|,forecolor,backcolor',
'theme_advanced_buttons3' => 'tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,insertdate,inserttime,|,ltr,rtl,',
'theme_advanced_buttons4' => 'charmap,emotions,iespell,media,advhr,|,fullscreen,preview,|,styleprops,spellchecker,|,cite,del,ins,attribs,|,visualchars,nonbreaking,blockquote,pagebreak', //insertlayer,moveforward,movebackward,absolute,|,|,abbr,acronym,template,insertfile,insertimage
'theme_advanced_blockformats' => 'p,address,pre,h1,h2,h3,div,blockquote,cite',
'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',
'theme_advanced_font_sizes' => '1,2,3,4,5,6,7',
'theme_advanced_more_colors' => 1,
'theme_advanced_toolbar_location' => 'top',
'theme_advanced_toolbar_align' => 'left',
'theme_advanced_statusbar_location' => 'bottom',
//'theme_advanced_styles' => 'Note=ccm-note',
'theme_advanced_resizing' => true
));
break;


となってると思います。
この箇所の


'theme_advanced_blockformats' => 'p,address,pre,h1,h2,h3,div,blockquote,cite',


に、h4,h5,h6と追加してやればOKです。

もし「詳細」ツールバーで見出しを追加するならcase: "ADVANCED"の該当箇所に修正を加えます。


※この検証は、concrete5.6.3.1で行っています。

Re: 記事エディターのオフィスモードにh4以降の段落を選択できるようにしたいです

2014年10月22日 at 17:47
kohkiさま

ご教示ありがとうございます!
【2】の方法で希望とおりの変更ができました。助かりました!