Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

Note

Backend documentation is in progress.

While creating sitemap, there can be added additional links

vendor/magento/module-sitemap/Model/ItemProvider/Composite.php:31
Code Block
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
Code Block
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
Code Block
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.

...