1

I'd like to make a template that generates an XML sitemap for my multilanguage site (using Transcribe addon) that contains all entries in all languages. The site structure is just simple flat pages like so:

/en/page1-english
/en/page2-english
/de/page1-german
/de/page2-german

I tried this code and it works apart from the exp:transcribe:uri tag only gives me a link for the default language. How can I get transcribe to give me links for all entries in all languages?

<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
{exp:channel:entries channel="not products"  transcribe="disable" dynamic="no"}
<url>
<loc>
{exp:transcribe:uri path="{url_title}"}
</loc></url>
{/exp:channel:entries}
</urlset>

1 Answer 1

3

Well I worked it out by myself in the end...

<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
{!--Homepage--}
<url>
  <loc>{site_url}</loc>
</url>
{exp:query sql="SELECT l.abbreviation, t.url_title, c.channel_name FROM exp_channel_titles t 
inner join exp_channels c using (channel_id)
inner join exp_transcribe_entries_languages el using (entry_id) 
inner join  `exp_transcribe_languages` l on l.id = el.language_id
where t.status='open' and c.channel_name<>'products'"}
<url>
{if channel_name=='home_page'}
  <loc>{site_url}/{abbreviation}</loc>
{if:else}
  <loc>{site_url}/{abbreviation}/{url_title}</loc>
{/if}
</url>
{/exp:query}
</urlset>
1
  • 1
    Thanks for coming back to post your solution :) I'm sure this will help someone else in future. Aug 19, 2013 at 4:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.