diff --git a/common/config/main.php b/common/config/main.php index efd2a4d..ab8b501 100644 --- a/common/config/main.php +++ b/common/config/main.php @@ -1,6 +1,6 @@ controller->id, $this->close)){ + return 'noindex, nofollow'; + } + if (array_search(\Yii::$app->request->pathInfo, $this->close)){ + return 'noindex, nofollow'; + } + + if (!empty($this->robots)) { + return $this->robots; + } + + if (!empty($this->alias) && !empty($this->alias->getRobots())) { + return $this->alias->getRobots(); + } + + return 'index,follow'; + } + + } \ No newline at end of file diff --git a/frontend/config/main.php b/frontend/config/main.php index 88db717..2271211 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -1,5 +1,5 @@ registerJs($js, View::POS_READY); } + + $this->registerMetaTag( + [ + 'name' => 'robots', + 'content' => $seo->robots, + ] + ); ?> beginPage() ?> diff --git a/frontend/views/support/index.php b/frontend/views/support/index.php index e9a43be..ee09a5a 100644 --- a/frontend/views/support/index.php +++ b/frontend/views/support/index.php @@ -2,10 +2,15 @@ /** * @var \common\models\Book $book * @var \common\models\Support $model + * @var \artbox\core\components\SeoComponent $seo */ - use yii\helpers\Html; + use artbox\core\models\Alias;use yii\helpers\Html; use yii\widgets\ActiveForm; - + $seo = \Yii::$app->get('seo'); + + $seo->setAlias(new Alias([ + 'title' => 'Підтримати книгу "'.$book->title.'"' + ])); ?>
-- libgit2 0.21.4