Industry & Types template pages (#226)

* Industry & Types template pages

* fix sitemap for templates
This commit is contained in:
formsdev
2023-10-25 00:25:15 +05:30
committed by GitHub
parent 4614dc0f18
commit 2d0d4a65c2
9 changed files with 618 additions and 54 deletions

View File

@@ -36,6 +36,8 @@ class SeoMetaResolver
'integrations' => '/integrations',
'templates' => '/form-templates',
'templates_show' => '/form-templates/{slug}',
'templates_types_show' => '/form-templates/types/{slug}',
'templates_industries_show' => '/form-templates/industries/{slug}',
];
/**
@@ -192,4 +194,26 @@ class SeoMetaResolver
'image' => $template->image_url
];
}
private function getTemplatesTypesShowMeta(): array
{
$types = json_decode(file_get_contents(resource_path('data/forms/templates/types.json')), true);
$type = $types[array_search($this->patternData['slug'], array_column($types, 'slug'))];
return [
'title' => $type['meta_title'],
'description' => Str::of($type['meta_description'])->limit(140),
];
}
private function getTemplatesIndustriesShowMeta(): array
{
$industries = json_decode(file_get_contents(resource_path('data/forms/templates/industries.json')), true);
$industry = $industries[array_search($this->patternData['slug'], array_column($industries, 'slug'))];
return [
'title' => $industry['meta_title'],
'description' => Str::of($industry['meta_description'])->limit(140),
];
}
}