<?php

/**
 * @var $this yii\web\View
 * @var $model string|\gromver\platform\news\models\Category
 */
?>

<h1 class="page-title title-category"><?php 
echo \yii\helpers\Html::encode($model->title);
?>
</h1>

<?php 
echo \gromver\platform\news\widgets\CategoryList::widget(['id' => 'cat-cats', 'category' => $model, 'context' => $this->context->context]);
Ejemplo n.º 2
0
<?php

/**
 * @var $this yii\web\View
 * @var $model string|\gromver\platform\news\models\Category
 */
?>

<h1 class="page-title title-category"><?php 
echo \yii\helpers\Html::encode($model->title);
?>
</h1>

<?php 
echo \gromver\platform\news\widgets\CategoryList::widget(['id' => 'cat-cats', 'category' => $model, 'listViewOptions' => ['emptyTextOptions' => ['class' => 'hidden']], 'context' => $this->context->context]);
echo \gromver\platform\news\widgets\PostList::widget(['id' => 'cat-posts', 'category' => $model, 'context' => $this->context->context]);
Ejemplo n.º 3
0
 * @var $this yii\web\View
 * @var $model gromver\platform\news\models\Category
 */
/** @var \gromver\platform\core\modules\menu\models\MenuItem $menu */
$menu = Yii::$app->menuManager->getActiveMenu();
if ($menu) {
    $this->title = $menu->isProperContext() ? $menu->title : $model->title;
    $this->params['breadcrumbs'] = $menu->getBreadcrumbs($menu->isApplicableContext());
    //category breadcrumbs
    if ($menu->isApplicableContext()) {
        //меню ссылается на категорию
        list($route, $params) = $menu->parseUrl();
        $_breadcrumbs = $model->getBreadcrumbs(false);
        while (($crumb = array_pop($_breadcrumbs)) && $crumb['url']['id'] != $params['id']) {
            $this->params['breadcrumbs'][] = $crumb;
        }
    }
} else {
    $this->title = $model->title;
    $this->params['breadcrumbs'] = $model->getBreadcrumbs(false);
}
$this->params['breadcrumbs'][] = $this->title;
//мета теги
if ($model->metakey) {
    $this->registerMetaTag(['name' => 'keywords', 'content' => $model->metakey], 'keywords');
}
if ($model->metadesc) {
    $this->registerMetaTag(['name' => 'description', 'content' => $model->metadesc], 'description');
}
echo \gromver\platform\news\widgets\CategoryList::widget(['id' => 'cat-cats', 'category' => $model, 'context' => $menu ? $menu->path : null]);