ExtendedSitemap
GitHub - magesuite/extended-sitemap
This module offers the possibility to add additional links to the sitemap.
Installation
This module is part of core metapackage
Installation if metapackage is not used:
composer require "creativestyle/magesuite-extended-sitemap" ^1.0.0
Admin settings
Admin setting can be adjusted in Store -> Configuration -> Advanced -> Extended sitemap
Settings:
Name | Value | Comment |
---|---|---|
Additional Links enabled | Yes/No |
|
Additional links |
| Path have to be without domain, for example for "site.com/contact" correct value is "/contact" |
Backend
Backend documentation is in progress.
While creating sitemap, there can be added additional links
vendor/magento/module-sitemap/Model/ItemProvider/Composite.php:31
class Composite implements ItemProviderInterface
{
public function getItems($storeId)
{
$items = [];
foreach ($this->itemProviders as $resolver) {
foreach ($resolver->getItems($storeId) as $item) {
$items[] = $item;
}
}
return $items;
}
}
Additional links, if enabled, are taken from configuration
vendor/creativestyle/magesuite-extended-sitemap/Model/ItemProvider/AdditionalLinks.php:26
class AdditionalLinks implements \Magento\Sitemap\Model\ItemProvider\ItemProviderInterface
{
public function getItems($storeId): array
{
if (!$this->configuration->isEnabled($storeId)) {
return [];
}
$items = [];
$additionalLinks = $this->configuration->getAdditionalLinks($storeId);
foreach ($additionalLinks as $additionalLink) {
$items[] = $this->itemFactory->create([
'url' => $additionalLink['path'],
'priority' => $additionalLink['priority'],
'changeFrequency' => $additionalLink['changeFrequency'],
]);
}
return $items;
}
}
vendor/creativestyle/magesuite-extended-sitemap/Helper/Configuration.php:29
Frontend
There are no frontend functionalities in this module.