From 31c230f69e39be5b67eb9604e81e2685eb63d5fc Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 15 Apr 2016 14:05:58 +0300 Subject: [PATCH] 15.04.16 seo widget --- frontend/widgets/Seo.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/frontend/widgets/Seo.php b/frontend/widgets/Seo.php index 36a57f2..d93765b 100644 --- a/frontend/widgets/Seo.php +++ b/frontend/widgets/Seo.php @@ -130,29 +130,26 @@ class Seo extends Widget protected function selectSeoData($param){ $result = ''; + $widgetData = $this->findSeoByUrl(); + if($widgetData instanceof \common\models\Seo){ - if(!empty($this->$param)){ + $result = $widgetData->$param; + + }else if(!empty($this->$param)){ $result = $this->$param; } else { - $widgetData = $this->findSeoByUrl(); + $widgetData = $this->findSeoByDynamic(); - if($widgetData instanceof \common\models\Seo){ + if($widgetData instanceof SeoDynamic){ $result = $widgetData->$param; - } else { - - $widgetData = $this->findSeoByDynamic(); - - if($widgetData instanceof SeoDynamic){ - $result = $widgetData->$param; - - } } + } return $this->replaceData($result); -- libgit2 0.21.4