0
2

More than 3 years have passed since last update.

CKEditor4のcustomConfigで躓いた

Posted at

CKEditorのconfigがどうやっても反映されなくて泣いていた.

公式に沿って,
headタグで

<script src="asset('ckeditor/ckeditor.js')"></script>

を読み込んでbodyの最後で,

<script type="text/javascript">
  CKEDITOR.replace('profile');
</script>

こうやれば,id="profile"がCKEditorに置き換わった.

でだ,

設定変えたくて,デフォルトのconfig.jsとは別に同じ階層に作った,config2.jsを読み込もうとしたのさ.
こんな感じで公式に沿った.

<script type="text/javascript">
  CKEDITOR.replace('profile',{ customConfig: '/ckeditor/ckeditor2.js' });
</script>

反映されない.

2時間は悩んだ.

CSSで無理やり消したりもした.

結果

これで解決できた.

<script type="text/javascript">
  CKEDITOR.config.customConfig = '/ckeditor/adminconfig.js';
  CKEDITOR.replace('profile');
</script>

先にcustomConfigを置き換えてから.replaceだった.

睡眠時間返してほしい.

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2