I create a new content with Spanish as "Original language" and after that, I add the translation for English.
http://example.com/es/contenido-de-ejemplo (Original Language)
http://example.com/en/content-example
Both links should be included in its sitemap.xml generated by language.
Sitemap for Spanish: http://example.com/es/sitemap.xml
Sitemap for English: http://eample.com/en/sitemap.xml
http://example.com/es/contenido-de-ejemplo (Original Language) is included in its sitemap (domain/es/sitemap.xml). However its translation is not included in domain/en/sitemap.xml
Any idea how to make xmlsitemap module get all contents (originals and translations)?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#16 | undefined_variable_is_translation-2906643-16.patch | 2.63 KB | a.milkovsky |
#11 | undefined_variable_is_translation-2906643-11.patch | 599 bytes | leymannx |
Comments
Comment #2
multidimension CreditAttribution: multidimension commentedHello,
I have the same problem when using different domains:
https://shoppinginromania.ro/sitemap.xml
https://shoopinginromania.com/sitemap.xml
Most Articles have translations. The articles are different content types.
Best regards.
Comment #3
SkinSame problem
Comment #4
multidimension CreditAttribution: multidimension commentedAfter debugging the module in detail I observed this is not build to use translations at all. The reason for this is that it's using the entity id with the node type as a primary key, so even if you force a translated entity it will identify and overwrite the previous language. To handle this I did the following:
1) in xmlsitemap.module I modified the xmlsitemap_xmlsitemap_process_entity_links function to handle translations:
In src/XmlSitemapLinkStorage.php I was forced to modify the create method to handle a different id, by appending the language id as well.
Please use this at your own risk, but for me it is working properly: http://shoppinginromania.ro/sitemap.xml and http://shoppinginromania.com/sitemap.xml
Comment #5
Lukas von Blarer@multidimension could you please create a patch?
Comment #6
multidimension CreditAttribution: multidimension commentedI will try. I am very limited in terms of time. Also I am not sure this is the best method, but for the time being this works with existing websites. For new websites I would suggest looking into a schema update as well or adding a separate indexing as a primary key.
Comment #7
Himanshu5050 CreditAttribution: Himanshu5050 for Infosys commentedPatch to support for content translation as in #4
Comment #8
Himanshu5050 CreditAttribution: Himanshu5050 for Infosys commentedresubmitting patch.
Comment #9
manuel.adanFor multilingual sites, simple_sitemap works perfectly. I found it after spent several hours trying to make xmlsitemap run on a multilingual site with no success.
Comment #10
leymannxComment #11
leymannxFor what I can see, nearly everything is in
8.x-1.x-dev
now. Only thing missing was the$is_translation = false
parameter frompublic function create()
so that later this variable is undefined.Comment #12
leymannxComment #13
leymannxComment #14
Dave ReidDo we even need the patch in #11 now?
Comment #15
Dave ReidI believe this is resolved by #2941164: using rel="alternate" rather than multiple sitemaps by language context (Drupal 8) now.
Comment #16
a.milkovskyOur SEO expert says, that we still should generate one sitemap per language. This SEO thing is always confusing.
I will just leave my patch here. It provides a new option "Include non-existent translations".
Comment #17
olambert CreditAttribution: olambert commentedHello,
<<>>
We have the same kind of problems.
We have 3 domains and each domain has 2 or 3 languages (see below).
The default language is English (common to the 3 domains).
The 2 other languages are not properly indexed into Google.
I am confused with all comments and changes.
I have three questions:
1) Should we create specific sitemaps by languages?
2) Which module(s) and patch(es) would you install for this?
3) How to make a language more important for a specific country?
Thanks community !!
www.abcompany.be/fr
www.abcompany.be/nl (more important language)
www.abcompany.be/en
www.abcompany.fr/fr (more important language)
www.abcompany.fr/en
www.abcompany.nl/nl (more important language)
www.abcompany.nl/en