Warning: You are browsing the documentation for PrestaShop 8, which is outdated.
You might want to read an updated version of this page for the current version, PrestaShop 9. Read the updated version of this page
Hook | actionModifyFrontendSitemap |
---|---|
Locations | FO |
Type | action |
Origin | core |
Aliases | |
Description | For example landing pages, blog posts and others. |
Origin | File |
---|---|
core | controllers/front/SitemapController.php |
Hook::exec(
'actionModifyFrontendSitemap',
['urls' => &$sitemapUrls],
null,
false,
true,
false,
null,
true
);
public function hookActionModifyFrontendSitemap($params)
{
$customUrls = [
[
'id' => 'custom-url-1',
'label' => 'Custom URL',
'url' => 'https://prestashop-project.org',
]
];
$params['urls']['pages']['links'] = array_merge($params['urls']['pages']['links'], $customUrls); // add custom urls to pages group
unset($params['urls']['categories']); // hide categories
}