Open Mahan-F opened 6 years ago
I found a first workaround. In extensions/vendor/bolt/sitemap/templates/sitemap_xml.twig, you can replace
by
@Thierry75974 Thanks! I'm going to use this fix for now.
@Thierry75974 - Thank you, @Mahan-F : you might be interested in this. Instead of what @Thierry75974 did above, I used:
This specifically trimmed the first "en" out of the URL, leaving me with the properly formatted URL.
Just for completeness's sake; This is still broken, using version 2.5.0. I'lll try the workaround for now, glad I checked if there was an issue for it.
What I did was:
{{ url('homepage')|trim('/en', 'right')|trim('/nl', 'right') }}
(trim all posible locales from the homepage slug. In my case en
and nl
)
Extra issue: When your slugs are translated (as they should be), the extension produces the wrong slug in every language but the default.
example: NL page: domain.nl/nl/naam-van-de-pagina EN page: domain.nl/en/name-of-the-page
In sitemap:
domain.nl/nl/naam-van-de-pagina
and
domain.nl/en/naam-van-de-pagina
(Because the extension does not consider the en-slug
and nl-slug
)
Should be fixed in release 2.6.0!
I'm using animal/translate v4.2.1 and bolt/sitemap v2.6.0. I don't get any more URLs in my sitemap, just the pages in one locale (strangely, the second locale, not the default one). What am I missing?
I added the sitemap routes in routing.yml (as suggested in the readme) and it gives one sitemap per locale (/fr/sitemap.xml
, /en/sitemap.xml
). Is this the normal behavior? I was looking for a way of generating a truly multilingual sitemap, with <xhtml:link rel="alternate" … />
tags in each <url>
.
I am using Sitemap version 2.3.0 and Translate version 4.1.1 on my Bolt website and the generated
sitemap.xml
file is using wrong URLs.All URLs in my sitemap are like this:
The language is repeated 2 times
en/en/