2amigos / yii2-ckeditor-widget

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

CKEditor widget does not render nor does the tinymce widget #99

Closed logofakt closed 7 years ago

logofakt commented 7 years ago

In my project with advanced template CKEditor widget does not render. composer.json looks as shown below:

"minimum-stability": "stable",
"require": {
    "php": ">=5.4.0",
    "yiisoft/yii2": ">=2.0.6",
    "yiisoft/yii2-bootstrap": "*",
    "yiisoft/yii2-swiftmailer": "*",
    "yiisoft/yii2-twig": "~2.0.0",
    "yii2tech/ar-softdelete": "*",
    "yii2tech/ar-position": "*",
    "rmrevin/yii2-fontawesome": "~2.12",
    "kartik-v/yii2-krajee-base": "@dev",
    "kartik-v/yii2-widgets": "*",
    "kartik-v/yii2-nav-x": "*",
    "kartik-v/yii2-dropdown-x": "*",
    "kartik-v/yii2-context-menu": "*",
    "kartik-v/yii2-mpdf": "*",
    "kartik-v/yii2-tree-manager": "@dev",
    "kartik-v/yii2-grid": "@dev",
    "kartik-v/yii2-detail-view": "*",
    "kartik-v/yii2-dialog": "*",
    "kartik-v/yii2-checkbox-x": "*",
    "dektrium/yii2-user": "0.9.*@dev",
    "dektrium/yii2-rbac": "1.0.0-alpha@dev",
    "navatech/yii2-roxymce" : "@dev",
    "alexantr/yii2-elfinder": "*",
    "2amigos/yii2-file-upload-widget": "~1.0",
    "2amigos/yii2-tinymce-widget" : "*",
    "2amigos/yii2-ckeditor-widget" : "~1.0",
    "2amigos/yii2-gallery-widget": "~1.0",
    "2amigos/yii2-taggable-behavior": "~1.0"
},

And this is the form: <?php

use yii\helpers\Html; use yii\helpers\ArrayHelper; use kartik\form\ActiveForm; use kartik\widgets\DateTimePicker; use kartik\checkbox\CheckboxX; use rmrevin\yii\fontawesome\FA; use dosamigos\ckeditor\CKEditor;

/ @var $this yii\web\View / / @var $model common\models\Block / / @var $form yii\widgets\ActiveForm / ?>

field($model, 'content')->widget(CKEditor::className(), [ 'options' => ['rows' => 6], 'preset' => 'full' ]); ?>
field($model, 'block_position')->dropDownList( Yii::$app->lookup->items('blockPosition'), ['prompt' => '--- '.yii::t('app', 'Wählen').' ---'] )?> field($model, 'order_number')->textInput() ?> field($model, 'author_id')->dropdownlist( ArrayHelper::map(common\models\User::find()->all(), 'id', 'username'), ['options' => [ yii::$app->user->id => ['selected ' => true]]]) ?> field($model, 'publish')->widget(CheckboxX::className(), [ 'options'=>['id'=>'publish'], 'pluginOptions'=>['threeState'=>false], ]); ?> field($model, 'publish_start')->widget(DateTimePicker::classname(), [ 'options' => ['placeholder' => yii::t('app', 'Erscheinungsdatum ab ...')], 'language' => 'de', 'pluginOptions' => [ 'autoclose'=>true, 'format' => 'yyyy-mm-dd hh:mm', 'todayHighlight' => true, 'todayBtn' => true, ] ]); ?>
field($model, 'publish_stop')->widget(DateTimePicker::classname(), [ 'options' => ['placeholder' => yii::t('app', 'Erscheinungsdatum bis ...')], 'language' => 'de', 'pluginOptions' => [ 'autoclose'=>true, 'format' => 'yyyy-mm-dd hh:mm', 'todayHighlight' => true, 'todayBtn' => true, ] ]); ?>
field($model, 'button_link')->textInput() ?> field($model, 'button_target')->dropDownList( Yii::$app->lookup->items('target'))?> field($model, 'button_text')->textInput(['maxlength' => true]) ?>
FA::icon('check')]), ['class' => 'btn btn-success']) ?> FA::icon('ban')]), ['index', 'showSearch' => false], ['class' => 'btn btn-danger']) ?>

Changing preset doesn't help. So is it because of dependencies e.g. Kartik widgets? Do I have a wrong version? Can't really figure it out and would appreciate any help as I need CKEditor in this project.

tonydspaniard commented 7 years ago

You forgot to echo de field ;)

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

or


 <?php
            echo $form->field($model, 'content')->widget(CKEditor::className(), [
                'options' => ['rows' => 6],
                'preset' => 'full'
            ]);
       ?>
logofakt commented 7 years ago

Thanks a lot ... such a stupidity!

tonydspaniard commented 7 years ago

shit happens 👍 @logofakt