diff --git a/backend/views/layouts/menu_items.php b/backend/views/layouts/menu_items.php index 004d7ab..886c67e 100755 --- a/backend/views/layouts/menu_items.php +++ b/backend/views/layouts/menu_items.php @@ -30,20 +30,20 @@ }, ], [ - 'label' => \Yii::t('core', 'Static pages'), - 'url' => '#', - 'icon' => 'file-text', + 'label' => \Yii::t('core', 'Static pages'), + 'url' => '#', + 'icon' => 'file-text', 'items' => [ [ - 'label' => \Yii::t('core', 'Pages'), - 'url' => [ '/page/index' ], - 'icon' => 'file-text', + 'label' => \Yii::t('core', 'Pages'), + 'url' => [ '/page/index' ], + 'icon' => 'file-text', ], [ - 'label' => \Yii::t('core', 'Categories'), - 'url' => [ '/page-category/index' ], - 'icon' => 'archive', - ] + 'label' => \Yii::t('core', 'Categories'), + 'url' => [ '/page-category/index' ], + 'icon' => 'archive', + ], ], ], [ @@ -96,9 +96,14 @@ ], ], [ - 'label' => \Yii::t('core', 'Image manager'), - 'url' => [ '/imagemanager' ], - 'icon' => 'image', + 'label' => \Yii::t('core', 'Image manager'), + 'url' => [ '/imagemanager' ], + 'icon' => 'image', + ], + [ + 'label' => \Yii::t('artbox-comment', 'Comments'), + 'url' => [ '/comment' ], + 'icon' => 'comment', ], ] ); \ No newline at end of file diff --git a/frontend/controllers/BlogController.php b/frontend/controllers/BlogController.php index cd3810f..94c4b95 100644 --- a/frontend/controllers/BlogController.php +++ b/frontend/controllers/BlogController.php @@ -36,4 +36,28 @@ ] ); } + + public function actionCategory() + { + $query = Article::find() + ->with('lang.alias') + ->with('image') + ->where([ 'status' => true ]); + + $dataProvider = new ActiveDataProvider( + [ + 'query' => $query, + 'pagination' => [ + 'pageSize' => 3, + ], + ] + ); + + return $this->render( + 'index', + [ + 'dataProvider' => $dataProvider, + ] + ); + } } \ No newline at end of file diff --git a/frontend/views/blog/_article.php b/frontend/views/blog/_article.php index 1b6fcde..ecdb23d 100644 --- a/frontend/views/blog/_article.php +++ b/frontend/views/blog/_article.php @@ -1,6 +1,8 @@
-

Fashion now

+

lang->title ?>

- - Example blog post alt + + image) ? \Yii::getAlias('@frontend/web/img/no-image.png') : $model->image->getPath() ) + ) + ->resize(600, 300) + ->renderImage( + [ + 'class' => 'img-responsive', + 'alt' => $model->lang->title, + ] + ) ?>
-

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean - ultricies mi vitae est. Mauris placerat eleifend leo.

-

Continue reading +

lang->body_preview?>

+

Continue reading

diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index e5fc42a..bdfc8b1 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -299,6 +299,10 @@ 'url' => [ 'site/price' ], ]; $items[] = [ + 'label' => \Yii::t('app', 'Блог'), + 'url' => [ 'blog/index' ], + ]; + $items[] = [ 'label' => \Yii::t('app', 'Контакты'), 'url' => [ 'site/contact' ], ]; -- libgit2 0.21.4