Commit 04f13c9b22e6d6aa789d478b8b7ed7cc1b0f37a4

Authored by Alexey Boroda
1 parent af359dbb

-Seo sort and pagination fix v2

Showing 1 changed file with 12 additions and 13 deletions   Show diff stats
@@ -180,20 +180,19 @@ class Seo extends Widget @@ -180,20 +180,19 @@ class Seo extends Widget
180 /** 180 /**
181 * Sort and pagination SEO fix 181 * Sort and pagination SEO fix
182 */ 182 */
  183 + if (strpos(\Yii::$app->request->url, 'sort=') !== false || strpos(\Yii::$app->request->url, 'perPage=') !== false) {
  184 + $this->getView()->registerMetaTag([
  185 + 'name' => 'robots',
  186 + 'content' => 'noindex,nofollow'
  187 + ]);
  188 + break;
  189 + }
183 if (strpos(\Yii::$app->request->url, 'per-page=') !== false) { 190 if (strpos(\Yii::$app->request->url, 'per-page=') !== false) {
184 - if (strpos(\Yii::$app->request->url, 'sort=') !== false || strpos(\Yii::$app->request->url, 'perPage=') !== false) {  
185 - $this->getView()->registerMetaTag([  
186 - 'name' => 'robots',  
187 - 'content' => 'noindex,nofollow'  
188 - ]);  
189 - break;  
190 - } else {  
191 - $this->getView()->registerMetaTag([  
192 - 'name' => 'robots',  
193 - 'content' => 'noindex,follow'  
194 - ]);  
195 - break;  
196 - } 191 + $this->getView()->registerMetaTag([
  192 + 'name' => 'robots',
  193 + 'content' => 'noindex,follow'
  194 + ]);
  195 + break;
197 } 196 }
198 197
199 if(!empty($filter) && !$this->checkFilter($filter) && count($filter, COUNT_RECURSIVE) == 2 && $priority==3){ 198 if(!empty($filter) && !$this->checkFilter($filter) && count($filter, COUNT_RECURSIVE) == 2 && $priority==3){