From 013622b2c6a3ccbc14cc868eec5e960a4f182fc4 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 21 Jun 2017 14:52:14 +0300 Subject: [PATCH] -Seo description fix --- widgets/Seo.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/widgets/Seo.php b/widgets/Seo.php index a5ff8d6..2e25192 100755 --- a/widgets/Seo.php +++ b/widgets/Seo.php @@ -150,21 +150,20 @@ class Seo extends Widget $description = $this->selectSeoData(self::DESCRIPTION, $filter,$priority); if (!empty($description)) { - - $this->getView()->registerMetaTag([ - 'name' => 'description', - 'content' => $this->prepareString($description) - ]); - - } else { - + if(!empty($filter)){ $array = $this->arrayBuilder($filter); $this->getView()->registerMetaTag([ - 'name' => 'description', - 'content' => $this->prepareString($this->getDescriptionString($array,$description)) - ]); + 'name' => 'description', + 'content' => $this->prepareString($this->getDescriptionString($array,$description)) + ]); + break; } + + $this->getView()->registerMetaTag([ + 'name' => 'description', + 'content' => $this->prepareString($description) + ]); } @@ -416,6 +415,9 @@ class Seo extends Widget $row = ''; foreach($array as $name => $field){ + if (isset($this->fields['name'])) { + $field['value'] = str_replace($this->fields['name'], '', $field['value']); + } $row .= $field['value'].' ' ; } $template = preg_replace('/{filter}/',$row, $description); -- libgit2 0.21.4