我正在尝试通过2amigos小部件为yii2添加oembed插件到ckeditor。
我做了以下操作,但似乎无法显示按钮:
我使用下面的代码在表单中设置widget的clientOptions:
$form->field($theComment, 'comment')->widget(CKEditor::className(), [
'clientOptions' => ['config.extraPlugins' => 'widget,oembed'],
'options' => ['rows' => 6],
'preset' => 'full'
])
我通过在下面添加以下代码行来修改full.php预设filworkinge:
'toolbarGroups' => [
['name' => 'document', 'groups' => ['mode', 'document', 'doctools']],
['name' => 'clipboard', 'groups' => ['clipboard', 'undo']],
['name' => 'editing', 'groups' => [ 'find', 'selection', 'spellchecker']],
['name' => 'forms'],
'/',
['name' => 'basicstyles', 'groups' => ['basicstyles', 'colors','cleanup']],
['name' => 'paragraph', 'groups' => [ 'list', 'indent', 'blocks', 'align', 'bidi' ]],
['name' => 'links'],
['name' => 'insert'],
'/',
['name' => 'styles'],
['name' => 'blocks'],
['name' => 'colors'],
['name' => 'tools'],
['name' => 'others'],
'/', //added by me
['name' => 'oembed'], //added by me
],
不完全确定错误是在我对clientOptions的编辑中,还是在我对toolbarGroups的编辑中,或者两者兼而有之!任何关于我做错事的想法都将不胜感激。
谢谢!
答案 0 :(得分:0)
插件添加资产文件夹(示例插件剧透)zarnica.dev \ www \ assets \ dff59c5c \ plugins \ spoiler
<script>CKEDITOR.config.extraPlugins = 'spoiler';</script>
DONE!