M
M
Maxim Timofeev2015-10-15 13:32:30
JavaScript
Maxim Timofeev, 2015-10-15 13:32:30

How to set up ckeditor for yii2 so that it doesn't cut off the code?

There are two widgets
mihaildev\ckeditor
and
mihaildev\elfinder
The output of the widget looks like this:

<?= $form->field($model, 'body')->widget(CKEditor::className(), [
  'editorOptions' =>
      ElFinder::ckeditorOptions('elfinder',['preset' => 'backend']),
  ]) ?>

Task: to forbid the editor to cut the code. For example, adding the Instagram widget code to html, it eats up part of its code when switching between html and the visual editor.
Has anyone come across these widgets and this task?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2015-10-16
@webinar

Clumsy editor. Spat, demolished put imperavi

B
benderalex5, 2019-08-30
@benderalex5

<?= $form->field($model, 'body')->widget(
    CKEditor::className(),
    [
                    'options' => ['rows' => 6],

                    'clientOptions' => [
                        'fullPage' => true,
                        'extraPlugins' => 'docprops',
                        'allowedContent' => true,
                    ]
                ]

            ) ?>

this is for the 2amigos/ckeditor plugin,
in your case you will most likely have to change - clientOptions to editorOptions
with these settings, the editor does not cut html and style tags

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question