From 54330e07a522bb927b6c22b722be68523ffaea68 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 29 Jun 2016 12:33:33 +0300 Subject: [PATCH] 29.06.16 --- frontend/widgets/Seo.php | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/frontend/widgets/Seo.php b/frontend/widgets/Seo.php index 626dc8a..47699f6 100755 --- a/frontend/widgets/Seo.php +++ b/frontend/widgets/Seo.php @@ -51,7 +51,41 @@ class Seo extends Widget switch ($this->row) { case self::SEO_TEXT: - return $this->selectSeoData(self::SEO_TEXT); + + + $filter = \Yii::$app->request->get('filter', []); + $sort = \Yii::$app->request->get('sort', []); + $paginate = \Yii::$app->request->get('page', []); + + if(empty($filter) && empty($sort) && empty($paginate) ){ + + return $this->selectSeoData(self::SEO_TEXT); + + } else { + + $widgetData = $this->findSeoByUrl(); + + $result = ''; + + if ($widgetData instanceof \common\models\Seo) { + + $result = $widgetData->{self::SEO_TEXT}; + + } else { + + $widgetData = $this->findSeoByDynamic(); + + if ($widgetData instanceof SeoDynamic) { + + $result = $widgetData->{self::SEO_TEXT}; + + } + + } + + return $this->replaceData($result); + } + break; case self::H1: -- libgit2 0.21.4