Esempio n. 1
0
<?php

/* @var $this yii\web\View */
/* @var $post common\models\ar\Post */
use yii\helpers\Html;
use app\components\widgets\SimilarPostsWidget;
use common\components\helpers\GlobalHelper;
use app\components\widgets\CommentsWidget;
use app\components\widgets\RatingWidget;
use app\components\widgets\FavoriteWidget;
foreach (GlobalHelper::getCategoryBreadcrumb(Yii::$app->params['category'][0]) as $cBreadcrumb) {
    $this->params['breadcrumbs'][] = ['label' => Html::a($cBreadcrumb['label'], $cBreadcrumb['link']), 'encode' => false];
}
$this->params['breadcrumbs'][] = $post->title;
// Проверяем, добавлены ли мета-тэги и включаем их в код страницы
if ($post->meta_keywords) {
    $this->registerMetaTag(['name' => 'keywords', 'content' => $post->meta_keywords], 'keywords');
}
if ($post->meta_descr) {
    $this->registerMetaTag(['name' => 'description', 'content' => $post->meta_descr], 'description');
}
if ($post->meta_title) {
    $this->title = $post->meta_title;
} else {
    $this->title = $post->title;
}
// Добавляем canonical
$this->registerLinkTag(['rel' => 'canonical', 'href' => $post->absoluteLink]);
?>
<div id="post-id"><?php 
echo $post->id;