Hello,

Is it possible to chunk or group multiple sitemaps by langcode into your batch file?

For example: An Index sitemap with multiple sub sitemaps for each language.

I am looking at the BatchUrlGenerator.php code. Do you know if it is possible for an additional function to be included to specify languages for the ['results']['generate'] or I was trying to create a function that does somewhat a similar process to processSegment, but it's complicated to chunk the languages into separated sitemap files.

Form add a Checkbox.
[] Separated by Languages.
Checked to separate sitemap sub files by languages.

Comments

Frank Thoeny created an issue. See original summary.

gbyte’s picture

Assigned: Frank Thoeny » Unassigned
Priority: Major » Normal
Status: Active » Closed (works as designed)

This module aims to create sitemaps according to the hreflang standard which dictates not to divide multilingual sitemaps by language. Instead it provides all language versions of a URL for each URL. The non-hreflang way would be to devide sitemaps by languages, the xmlsitemap module is doing it.

Why do you need this language chunking anyway?

websmithc’s picture

I am also looking for this feature. We do NOT want HREFLANGs in our sitemap (we output them on the HTML pages instead, using meta tag module). AND we DO want the ability to control where the sitemap is written... preferably in the directory structure of the language URL. That is, www.example.com/de-de/sitemap.xml for the Germany-German pages that can be submitted via Google Search Console in that URL structure that has been tagged for Germany. It would also help our in-country web managers manage their site.

In a nutshell, this comment has three requirements:

  1. Ability to disable HREFLANGs
  2. Config setting for country-language URL based sitemaps that are included in the sitemap-index.xml file (the original ASK in this feature request)
  3. Ability to specify output file names and directory structure
websmithc’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
Status: Closed (works as designed) » Active
Issue tags: -XML sitemap chunked multiple language translation +xmlsitemap, +multilanguage
Rym’s picture

Hello Guys ,
Did you find a way to do that? I am looking for the same thing!

gbyte’s picture

@websmithc I believe all your requirements can be achieved with the 3.x version of the module which is close to its first stable release. There is an upgrade path throughout the dev versions, so they can be used without much hesitation.

The 3.x version introduces the concept of sitemap types, which are powered by URL and sitemap generators. It also introduces the concept of sitemap variants, which can be sitemap instances of any sitemap type living under a customized path. I will be publishing a blog post after releasing 1.0, but you can check out the release page here for more information.

What you would have to do is to implement new sitemap and URL generator plugins and then define sitemap variants according to your language needs (this step can be done via UI).

Feel free to drop me a line via the drupal contact form, in case you consider sponsoring this feature.

gbyte’s picture

Status: Active » Closed (works as designed)

I have written a comment summarizing what has to be done in order to get this to work.

A post about how to take advantage of the new concepts in 3.x will follow soon on my blog.

Feel free to reopen this issue in case of new insights.