jonimant. To achieve what you want - a single XML sitemap listing all documents in all languages, the sitemap needs to use a monolingual template, and you need to use the
[[YAMS? &get=`repeat` &repeattpl=`SitemapRepeat`]]
syntax.
Here’s a comprehensive step by step guide - since they seem to be quite popular...
Multilingual Sitemaps with YAMS
This creates a single XML sitemap listing all documents in all languages. It assumes that all your web documents are multilingual. If you have monolingual web documents you need to be more clever in order not to include them in your sitemap multiple times.
1. Create a new template called XMLSitemap
2. Include the following in your XMLSitemap template:
<?xml version="1.0" encoding="[(modx_charset)]" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" >
[*content*]
</urlset>
3. Go to the Modules > YAMS > Multilingual Templates. Select "no" for XMLSitemap and submit.
4. Create a new template variable.
Name: UrlsetChangeFreq
Caption: Change Frequency
Description: Specify how often this page is likely to be updated. Be honest!
Input type: DropDown List Menu
Input option values: always||hourly||daily||weekly||monthly||yearly||never
Default value: yearly
(or monthly, or whatever)
Associate the template variable with all your templates except XMLSitemap.
5. Create another new template variable
Name: UrlsetPriority
Caption: Priority
Description: If it is more/less important that google scans this page than other pages, give it a value higher/lower than 0.5. (Range 0...1)
Input type: Number
Input option values: (leave blank)
Default value: 0.5
Associate the template variable with all your templates except XMLSitemap.
6. Create a new chunk called SitemapRepeatTpl with your ditto call in it that generates the <url> blocks for all your documents. Ideally, all your web documents should be in a single folder, and &parents should be set to the id of that folder. The snippet call might look something like this:
[!Ditto? &language=`(yams_mname)` &parents=`1` &tpl=`UrlsetURL` &depth=`5` &dateSource=`editedon` &dateFormat=`%Y-%m-%d` &display=`all` &showInMenuOnly=`0` &seeThroughUnpub=`1` &filter=`type,reference,2|searchable,1,1`!]
where UrlsetURL is another chunk with the following contents
<url>
<loc>(yams_doc:[+id+])</loc>
<lastmod>[+date+]</lastmod>
<changefreq>[+UrlsetChangeFreq+]</changefreq>
<priority>[+UrlsetPriority+]</priority>
</url>
This ditto call specifies that there are maximum of 5 levels of folders - which can make the ditto call significantly more efficient in my experience, and excludes weblinks and un-searchable documents from the sitemap.
7. Create a new document with the alias sitemap.xml that lives outside your web root folder. Select the XMLSitemap template. Set the content type to text/xml. For the content, use
[[YAMS? &get=`repeat` &repeattpl=`SitemapRepeatTpl`]]
Hey presto - multilingual XML Sitemap. In addition, you can specify the change frequency and priority via the template variables attached to each document.