Am also working on an Intranet System where i have 12 different countries. What i did on mine is only allow the Admin to attribute the Country to each of his User so as to restrict certain section or any other information prior to their country.
But doing so how will you take restrict content if you a particular user doesnt have access to it ?
Set the website language / domain via c#
Hi there,
Does anyone know how can I go about setting the language via code?
Ive tried to change the values in the umbracoDomains table with no success.
Regards,
mkariti
What exactly do you want to do here ? You want to set the Language type or to dynamically display the language type ?
Hi Fuji,
Many thanks for your quick reply.
I just want to be able to let the user set the website language via radio button.
The user doesnt want to open nodes for each language and as its an intranet website there is no need for it.
Ive also tried to send the json request to the SaveLanguageAndDomains method but keep getting 500 errors.
I guess before compiling the source code I thought I'll better ask. Im sure there is an easy way or Ive just missed something.
Cheers
mkariti
Am also working on an Intranet System where i have 12 different countries. What i did on mine is only allow the Admin to attribute the Country to each of his User so as to restrict certain section or any other information prior to their country.
But doing so how will you take restrict content if you a particular user doesnt have access to it ?
Im more after setting the language via the front end. None of my users (in my case member) have access to the back end.
Only memer with the Admin role ca access the setting area (also found on the front end) and change the language for the current website.
You could just update the db table directly (umbracoDomains I believe)
However you need to clear come cache after changing the table.
Hi Rich,
Ive tried changing the umbracoDomains table and clear the cache using the following with no success:
umbraco.library.RePublishNodesDotNet(1060);
umbraco.library.RefreshContent();
umbraco.library.RePublishNodes(1060);
It seems as if only change in the web.config does the trick.
Any ideas?
Cheers
mkariti
Hmm, don't know.
It must be possible as it works via the UI, do you have the core source code to look at?
ok so I’ve managed to solve it by sending my json to the same method found in:
'/umbraco/Api/DomainsApi/SaveLanguageAndDomains'
Regards,
mkariti
Hello, when I'm trying to add a new domain on my live website I get the exception
https://pastebin.com/raw/QBf0T12T
When I create vanilla Umbraco installation it works fine. Not sure what's wrong.
Anyone facing the same issue?
is working on a reply...