Industry & Types template pages (#226)
* Industry & Types template pages * fix sitemap for templates
This commit is contained in:
@@ -21,7 +21,7 @@ class SitemapController extends Controller
|
||||
['/login', 0.4],
|
||||
['/register', 0.4],
|
||||
['/password/reset', 0.3],
|
||||
['/templates', 0.9],
|
||||
['/form-templates', 0.9],
|
||||
];
|
||||
|
||||
public function getSitemap(Request $request)
|
||||
@@ -31,6 +31,8 @@ class SitemapController extends Controller
|
||||
$sitemap->add($this->createUrl($url[0], $url[1]));
|
||||
}
|
||||
$this->addTemplatesUrls($sitemap);
|
||||
$this->addTemplatesTypesUrls($sitemap);
|
||||
$this->addTemplatesIndustriesUrls($sitemap);
|
||||
|
||||
return $sitemap->toResponse($request);
|
||||
}
|
||||
@@ -48,4 +50,20 @@ class SitemapController extends Controller
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private function addTemplatesTypesUrls(Sitemap $sitemap)
|
||||
{
|
||||
$types = json_decode(file_get_contents(resource_path('data/forms/templates/types.json')), true);
|
||||
foreach ($types as $type) {
|
||||
$sitemap->add($this->createUrl('/form-templates/types/' . $type['slug'], 0.7));
|
||||
}
|
||||
}
|
||||
|
||||
private function addTemplatesIndustriesUrls(Sitemap $sitemap)
|
||||
{
|
||||
$industries = json_decode(file_get_contents(resource_path('data/forms/templates/industries.json')), true);
|
||||
foreach ($industries as $industry) {
|
||||
$sitemap->add($this->createUrl('/form-templates/industries/' . $industry['slug'], 0.7));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user