Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi!
I would like to retrieve the language that I have set on the top node of my multilingual site.
I want to save the language to a table in the db that i have created.
I cannot use the current language of the user because they can switch to a different part of the website that has a different language.
I want to get this from my usercontrol. Is that posible?
Ive tried to use the Domain class but as I understand it that is only if the langugae is set to just that node..?
Haven't really tested, but something like this?
Domain[] domains = umbraco.library.GetCurrentDomains(Node.GetCurrent().Id); if (domains != null) { foreach (Domain d in domains) { langList += d.Language.CultureAlias; } }
If you are using multiple languages/domains on one parent node you might need to do some matching of the domain
Thx :)
I just realized that i was totally wrong..
You DO actually get the current domain namn from Domain. I thought that was specific if you had assigned a domain to just that node..
Sorry..
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to get the language of current node
Hi!
I would like to retrieve the language that I have set on the top node of my multilingual site.
I want to save the language to a table in the db that i have created.
I cannot use the current language of the user because they can switch to a different part of the website that has a different language.
I want to get this from my usercontrol. Is that posible?
Ive tried to use the Domain class but as I understand it that is only if the langugae is set to just that node..?
Haven't really tested, but something like this?
If you are using multiple languages/domains on one parent node you might need to do some matching of the domain
Thx :)
I just realized that i was totally wrong..
You DO actually get the current domain namn from Domain. I thought that was specific if you had assigned a domain to just that node..
Sorry..
is working on a reply...