- Issue created by @brockfanning
- π©πͺGermany gbyte Berlin
The cleanest solution would be to programmatically create a new URL generator by overriding
\Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\SitemapIndexUrlGenerator
and setting the new generator instead of the old one on the sitemap index or create a new sitemap index entirely. Both can be done via UI.The simplest solution would be to use
hook_simple_sitemap_links_alter(array &$links, SimpleSitemapInterface $sitemap)
to alter the links. You can use $link['meta'] information to help you filter out the unwanted sitemaps.Let me know if that helps.
- πΊπΈUnited States brockfanning
Perfect, thank you!
I was also thinking maybe of a no-code solution: We set sitemap #1 to our "default", and then we could go to /admin/config/search/simplesitemap/custom and add a custom link in our default which links to sitemap #2. Do you see any problems with that approach?
- π©πͺGermany gbyte Berlin
I haven't tried it, but there may be a problem with it as a sitemap referencing other sitemaps may have a different structure to a sitemap referencing content links. I'd say try it and see if the output fulfills your requirements.
Automatically closed - issue fixed for 2 weeks with no activity.