2amigos / yii2-ckeditor-widget

CKEditor WYSIWYG widget for Yii2.
https://2amigos.us/open-source/ckeditor-widget
Other
172 stars 112 forks source link

Additional parameters have no effect #93

Closed dmitri-s closed 7 years ago

dmitri-s commented 7 years ago

After running a composer update the plugin no longer allow you to set preset to full. 'preset' => 'full', Setting it to full, standard or basic has no effect.

Also tried setting options->rows to 1,5,6,10,15,20 and had no effect on end form. 'options' => ['rows' => 6],

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

Please advice.

tonydspaniard commented 7 years ago

Do you mind testing against the 'master' branch? Maybe I missed to tag version.

dmitri-s commented 7 years ago

I am not composer guru. Been using Yii2 and composer for last few month. So, if I am doing something wrong - feel free to point it out. I will be happy to re-test.

Here is what I did:

  1. Change composer.json to include "2amigos/yii2-ckeditor-widget": "dev-master" under require.
    • That resulted in composer throwing an error that package does not satisfy minimal stability [dev-full/stable].
  2. I tried to select last commit this way: "2amigos/yii2-ckeditor-widget": "dev-master#60e4d2dbb138706c8c2195a1b29c420bda044b19" under requre.
    • That resulted in the same error.
  3. Changed minimal-stability to dev.
    • That resulted in composer installing 2amigos/yii2-ckeditor-widget (dev-master 60e4d2d). Which is matches last commit listed in github from Dec 1, 2016. (n.b. There were many other Yii2 packages that were updated as well. Could potentially skew results of the tests) Performed the following tests:
      <?= $form->field($model, 'text')->widget(CKEditor::className(), [
              'options' => ['rows' => 6],
              'preset' => 'full',
      ])?>

      Full shows up correctly: image

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

Standard shows up correctly: image

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

Basic shows up correctly: image

So option preset working as expected.

On the other hand 'options' => ['rows' => 6], still does not have any effect on the widget. Selecting 1, 6, 10, or 600 will result in the same window size. Will not bore you with screenshots.

Hope this helps, Code @( ' _ ' )@

tonydspaniard commented 7 years ago

@dmitri-s thanks for such great feedback. About the rows, I believe that you need to use the "height" attribute in clientOptions to change the size of the editor. Remember we are using the underline plugin, modifying the textarea attributes have no effect.

Azam2926 commented 7 years ago

I like full of preset

tonydspaniard commented 7 years ago

@Azam2926 have you tried this?


<?= $form->field($model, 'attributeName')->widget(CKEditor::className(), [
                'preset' => 'full', // <---- HERE
])?>