I'm trying to create an XSLT Macro to loop through all my separate Home Pages on a multilingual site. Each home page has its own subdomain and therefore alt URL (eg. "http://en.localhost", "http://fr.localhost", etc.). I was told I could do this in my language selector dropdown:
But this implies that I have a field called "Language" on my document type. I do not. Nor do I think I should have to add one. Why can't this be dynamic? I would think this would be a page built-in page property. But:
<xsl:value-of select="@Language'"/>
Doesn't work either. How do I get the language assigned to a particular page? So that I can redirect the user to the chosen home page?
As I explained previously, it is usually the case that the ISO country codes or culture name isn't necessarily what you want to show your users, but having said that there is bound to be a way to get the current culture - I'm just not aware of it!
If you just want to keep this out of your document type, you could always add a dictionary item for the current language.
getting assigned language
Hi,
I'm trying to create an XSLT Macro to loop through all my separate Home Pages on a multilingual site. Each home page has its own subdomain and therefore alt URL (eg. "http://en.localhost", "http://fr.localhost", etc.). I was told I could do this in my language selector dropdown:
But this implies that I have a field called "Language" on my document type. I do not. Nor do I think I should have to add one. Why can't this be dynamic? I would think this would be a page built-in page property. But:
Doesn't work either. How do I get the language assigned to a particular page? So that I can redirect the user to the chosen home page?
Thanks,
Garrett
Hi Garret
As I explained previously, it is usually the case that the ISO country codes or culture name isn't necessarily what you want to show your users, but having said that there is bound to be a way to get the current culture - I'm just not aware of it!
If you just want to keep this out of your document type, you could always add a dictionary item for the current language.
Dan
As to "how to do it" without a special docType setting you will need an xslt extension. See this thread for more info: http://our.umbraco.org/forum/developers/xslt/4747-How-do-you-retrieve-the-Culture-Code-for-a-given-Node
cheers,
doug.
is working on a reply...