/
ExtendedSitemap
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
class Configuration extends \Magento\Framework\App\Helper\AbstractHelper
{
public function getAdditionalLinks($storeId = null)
{
$value = $this->scopeConfig->getValue(
self::XML_PATH_CONFIGURATION_ADDITIONAL_LINKS,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
$storeId
);
return $this->serializer->unserialize($value);
}
}
Frontend
There are no frontend functionalities in this module.
Related content
PersistentSitemap
PersistentSitemap
More like this
Category
Read with this
SeoCanonical
SeoCanonical
More like this
2.9. Custom Links in Main Navigation
2.9. Custom Links in Main Navigation
More like this
StoreLocator (optional)
StoreLocator (optional)
More like this