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
Currently, i got an issue when I am getting the url of item in "UmbracoApiController".
The url always return default language, which is "/xxxx" instead of "/zh-HK/xxxx"
I have set the Culture on umbraco and also add these code before I get the content url.
Thread.CurrentThread.CurrentCulture = new CultureInfo("zh-HK");
Thread.CurrentThread.CurrentUICulture = new CultureInfo(language.Replace("zh-HK");
var url = item.Url;
Any ideas or solution for this case?
I think custom Umbraco API's that inherit from UmbracoApiController aren't culture aware. The URL will always be ~/Umbraco/Api/Controller/action no matter which site you call them from.
If you need your API method to know what culture to use, you may have to pass it as a parameter. Something like...
Hi Ben, Sorry for late reply. Yea, I have already pass the language through the parameter, and set the culture. The value which i get from vorto field is fine and correct. However, when i get the item.Url, the URL is always English. So i need to do the modification myself such as add the /lang/ before the url. Is there any wrong? Or it is normal.....
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted