Commit 013622b2c6a3ccbc14cc868eec5e960a4f182fc4
1 parent
7b0c8d58
-Seo description fix
Showing
1 changed file
with
13 additions
and
11 deletions
Show diff stats
widgets/Seo.php
@@ -150,21 +150,20 @@ class Seo extends Widget | @@ -150,21 +150,20 @@ class Seo extends Widget | ||
150 | $description = $this->selectSeoData(self::DESCRIPTION, $filter,$priority); | 150 | $description = $this->selectSeoData(self::DESCRIPTION, $filter,$priority); |
151 | 151 | ||
152 | if (!empty($description)) { | 152 | if (!empty($description)) { |
153 | - | ||
154 | - $this->getView()->registerMetaTag([ | ||
155 | - 'name' => 'description', | ||
156 | - 'content' => $this->prepareString($description) | ||
157 | - ]); | ||
158 | - | ||
159 | - } else { | ||
160 | - | 153 | + |
161 | if(!empty($filter)){ | 154 | if(!empty($filter)){ |
162 | $array = $this->arrayBuilder($filter); | 155 | $array = $this->arrayBuilder($filter); |
163 | $this->getView()->registerMetaTag([ | 156 | $this->getView()->registerMetaTag([ |
164 | - 'name' => 'description', | ||
165 | - 'content' => $this->prepareString($this->getDescriptionString($array,$description)) | ||
166 | - ]); | 157 | + 'name' => 'description', |
158 | + 'content' => $this->prepareString($this->getDescriptionString($array,$description)) | ||
159 | + ]); | ||
160 | + break; | ||
167 | } | 161 | } |
162 | + | ||
163 | + $this->getView()->registerMetaTag([ | ||
164 | + 'name' => 'description', | ||
165 | + 'content' => $this->prepareString($description) | ||
166 | + ]); | ||
168 | 167 | ||
169 | } | 168 | } |
170 | 169 | ||
@@ -416,6 +415,9 @@ class Seo extends Widget | @@ -416,6 +415,9 @@ class Seo extends Widget | ||
416 | 415 | ||
417 | $row = ''; | 416 | $row = ''; |
418 | foreach($array as $name => $field){ | 417 | foreach($array as $name => $field){ |
418 | + if (isset($this->fields['name'])) { | ||
419 | + $field['value'] = str_replace($this->fields['name'], '', $field['value']); | ||
420 | + } | ||
419 | $row .= $field['value'].' ' ; | 421 | $row .= $field['value'].' ' ; |
420 | } | 422 | } |
421 | $template = preg_replace('/{filter}/',$row, $description); | 423 | $template = preg_replace('/{filter}/',$row, $description); |