Commit dde8e67e58c92f9fb4571710dbdb1b9974086e90

Authored by Alex Savenko
1 parent 62ffca64

sitemap controller fix noindex

Showing 1 changed file with 5 additions and 0 deletions   Show diff stats
console/controllers/SiteMapController.php
@@ -144,26 +144,31 @@ class SiteMapController extends Controller @@ -144,26 +144,31 @@ class SiteMapController extends Controller
144 144
145 $content = '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; 145 $content = '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
146 146
  147 + //home page + home catalog
147 foreach ($this->getAddStatic() as $page) { 148 foreach ($this->getAddStatic() as $page) {
148 $this->createRow($page , 1,$content); 149 $this->createRow($page , 1,$content);
149 } 150 }
150 151
  152 + //static pages (contacts, about, etc)
151 foreach ($this->getStaticPages() as $page) { 153 foreach ($this->getStaticPages() as $page) {
152 $url = Url::to(['text/index','translit' => $page->translit]); 154 $url = Url::to(['text/index','translit' => $page->translit]);
153 $this->createRow($url , 1,$content); 155 $this->createRow($url , 1,$content);
154 } 156 }
155 157
  158 + //categories
156 foreach ($this->getCategories() as $category) { 159 foreach ($this->getCategories() as $category) {
157 $url = Url::to(['catalog/category', 'category' => $category]); 160 $url = Url::to(['catalog/category', 'category' => $category]);
158 $this->createRow($url , 1,$content); 161 $this->createRow($url , 1,$content);
159 } 162 }
160 163
  164 + //products
161 foreach ($this->getProducts() as $product) { 165 foreach ($this->getProducts() as $product) {
162 166
163 $url = Url::to(['catalog/product', 'product' => $product]); 167 $url = Url::to(['catalog/product', 'product' => $product]);
164 $this->createRow($url , 0.9, $content); 168 $this->createRow($url , 0.9, $content);
165 } 169 }
166 170
  171 + //articles
167 foreach ($this->getArticles() as $article) { 172 foreach ($this->getArticles() as $article) {
168 173
169 $url = Url::to(['articles/show', 'translit' => $article->translit, 'id' => $article->id,]); 174 $url = Url::to(['articles/show', 'translit' => $article->translit, 'id' => $article->id,]);