Commit d34b3a86 authored by andre's avatar andre

#1302

parent 6bf0ca93
...@@ -118,6 +118,8 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all(); ...@@ -118,6 +118,8 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all();
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?= $form->field($model, 'position')->textInput(['maxlength' => 3]) ?>
<?= $form->field($model, 'priority')->textInput(['maxlength' => 3])->hint('Приоритетность URL относительно других URL на Вашем сайте. Допустимый диапазон значений — от 0.0 до 1.0. Это значение позволяет указать поисковым системам, какие страницы, по Вашему мнению, более важны для сканеров (позволяет задать порядок их обработки ПС). Приоритет страницы по умолчанию — 0.5.') ?> <?= $form->field($model, 'priority')->textInput(['maxlength' => 3])->hint('Приоритетность URL относительно других URL на Вашем сайте. Допустимый диапазон значений — от 0.0 до 1.0. Это значение позволяет указать поисковым системам, какие страницы, по Вашему мнению, более важны для сканеров (позволяет задать порядок их обработки ПС). Приоритет страницы по умолчанию — 0.5.') ?>
<div class="form-group"> <div class="form-group">
......
...@@ -30,6 +30,9 @@ use common\modules\content\models\CoContent; ...@@ -30,6 +30,9 @@ use common\modules\content\models\CoContent;
'columns' => [ 'columns' => [
// 'name', // 'name',
//'url:url', //'url:url',
[
'attribute' => 'position',
],
[ [
'attribute' => 'url', 'attribute' => 'url',
'format' => 'raw', 'format' => 'raw',
......
...@@ -121,7 +121,7 @@ class CoContent extends \common\components\ActiveRecordModel ...@@ -121,7 +121,7 @@ class CoContent extends \common\components\ActiveRecordModel
public function rules() public function rules()
{ {
return [ return [
[['active', 'type', 'template_id'], 'integer'], [['active', 'type', 'template_id', 'position'], 'integer'],
[['file'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif'], [['file'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif'],
[['url', 'type', 'priority'], 'required'], [['url', 'type', 'priority'], 'required'],
[['url'], 'string', 'max' => 250], [['url'], 'string', 'max' => 250],
...@@ -148,7 +148,8 @@ class CoContent extends \common\components\ActiveRecordModel ...@@ -148,7 +148,8 @@ class CoContent extends \common\components\ActiveRecordModel
'active' => Yii::t('content', 'Active'), 'active' => Yii::t('content', 'Active'),
'created_at' => Yii::t('content', 'Created At'), 'created_at' => Yii::t('content', 'Created At'),
'updated_at' => Yii::t('content', 'Updated At'), 'updated_at' => Yii::t('content', 'Updated At'),
'template_id' => 'Шаблон для рассылки' 'template_id' => 'Шаблон для рассылки',
'position' => 'Позиция',
]; ];
} }
......
<?php
use yii\db\Migration;
use yii\db\Schema;
/**
* Handles adding column to table `co_content`.
*/
class m160712_165645_add_column_to_co_content extends Migration
{
public function safeUp()
{
$this->addColumn('co_content', 'position', Schema::TYPE_INTEGER . ' NOT NULL DEFAULT 0');
}
public function safeDown()
{
$this->dropColumn('co_content', 'translit');
}
}
...@@ -11,7 +11,7 @@ $models = CaseContent::find() ...@@ -11,7 +11,7 @@ $models = CaseContent::find()
'category_id' => \common\models\Settings::getValue('case-category-id'), 'category_id' => \common\models\Settings::getValue('case-category-id'),
'active' => true 'active' => true
]) ])
->orderBy('id DESC') ->orderBy('position DESC')
->all(); ->all();
?> ?>
<?php if($models) : ?> <?php if($models) : ?>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment