diff --git a/composer.json b/composer.json index e184fe0..39fb3d8 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,8 @@ "trntv/yii2-datetime-widget": "^1.0.0", "trntv/yii2-file-kit": "^1.0.0", "trntv/yii2-aceeditor": "^2.0", - "omcrn/yii2-base": "^0.1.1" + "omcrn/yii2-base": "^0.1.1", + "bower-asset/bootstrap-tagsinput": "^0.5.0" }, "autoload": { "psr-4": { diff --git a/migrations/m170126_103558_keywords_column_on_article_translation_table.php b/migrations/m170126_103558_keywords_column_on_article_translation_table.php new file mode 100644 index 0000000..0a7e486 --- /dev/null +++ b/migrations/m170126_103558_keywords_column_on_article_translation_table.php @@ -0,0 +1,27 @@ +addColumn(\centigen\i18ncontent\models\ArticleTranslation::tableName(), 'keywords', \yii\db\Schema::TYPE_STRING."(256)"); + } + + public function down() + { + $this->dropColumn(\centigen\i18ncontent\models\ArticleTranslation::tableName(), 'keywords'); + } + + /* + // Use safeUp/safeDown to run migration code within a transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} diff --git a/models/ArticleTranslation.php b/models/ArticleTranslation.php index 106e685..48c6570 100644 --- a/models/ArticleTranslation.php +++ b/models/ArticleTranslation.php @@ -17,6 +17,7 @@ * @property string $meta_title * @property string $meta_description * @property string $meta_keywords + * @property string $keywords * * @property Article $article */ @@ -41,7 +42,7 @@ public function rules() [['article_id'], 'integer'], [['body','short_description'], 'string'], [['locale'], 'string', 'max' => 15], - [['title', 'meta_title', 'meta_description', 'meta_keywords'], 'string', 'max' => 512] + [['title', 'keywords', 'meta_title', 'meta_description', 'meta_keywords'], 'string', 'max' => 512] ]; } @@ -60,6 +61,7 @@ public function attributeLabels() 'meta_title' => Yii::t('i18ncontent', 'Meta Title'), 'meta_description' => Yii::t('i18ncontent', 'Meta Description'), 'meta_keywords' => Yii::t('i18ncontent', 'Meta Keywords'), + 'keywords' => Yii::t('i18ncontent', 'Keywords'), ]; } diff --git a/views/article/_tab_content.php b/views/article/_tab_content.php index 04d9ade..ed46f87 100644 --- a/views/article/_tab_content.php +++ b/views/article/_tab_content.php @@ -15,6 +15,13 @@ 'name' => "{$className}[$language][title]" ] ])->textInput(['maxlength' => true]) ?> + +field($model, 'keywords', [ + 'inputOptions' => [ + 'name' => "{$className}[$language][keywords]" + ] +])->textInput(['maxlength' => true]) ?> + field($model, 'short_description')->widget( \yii\imperavi\Widget::className(), [