I have a bilingual site with a language switcher dropdown and recently discovered that it is not working properly. The way I created the Spanish site was as a copy of the English site, *chose to relate all copied items to the original*, and then am using domains ("en.gtpsites.com" and "es.gtpsites.com") and Dictionary items.
In general, or at least in part, the toggle works -- one way -- I can always toggle from Spanish to English and remain on the current page; however when I go the other way, it doesn't work, and I have figured out that this is because BOTH:
Are returning a different value to the front end depending on which language is selected! The way my dropdown works, or intends to work, is to take the domain name of the root node (eg. "en.gtpsites.com") and then append the URL of the current page onto it. When I am es.gtpsites.com, the value of returns as just the last part of the URL (for English), eg., "/about.aspx", but then on en.gtpsites.com, I get the full path! Eg., "http://en.gtpsites.com/about.aspx," which obviously doesn't work in an append. I will paste my code below. What is wrong with this?! Help!
RelateNode / NiceUrl Problems - Multilingual Sites
Hi,
I have a bilingual site with a language switcher dropdown and recently discovered that it is not working properly. The way I created the Spanish site was as a copy of the English site, *chose to relate all copied items to the original*, and then am using domains ("en.gtpsites.com" and "es.gtpsites.com") and Dictionary items.
In general, or at least in part, the toggle works -- one way -- I can always toggle from Spanish to English and remain on the current page; however when I go the other way, it doesn't work, and I have figured out that this is because BOTH:
umbraco.library:NiceUrl($currentPage/@id)
and
umbraco.library:NiceUrl($relatedNode/relations/relation/node/@id)
Are returning a different value to the front end depending on which language is selected! The way my dropdown works, or intends to work, is to take the domain name of the root node (eg. "en.gtpsites.com") and then append the URL of the current page onto it. When I am es.gtpsites.com, the value of returns as just the last part of the URL (for English), eg., "/about.aspx", but then on en.gtpsites.com, I get the full path! Eg., "http://en.gtpsites.com/about.aspx," which obviously doesn't work in an append. I will paste my code below. What is wrong with this?! Help!
Do the relations only go OIne way or something? Any help would be greatly, greatly appreciated.
Thanks.
Garrett
is working on a reply...