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
Hello community ;)
I'm triyng to get pages with the API using Umbraco.Content(xxxx).Children, but it always return the content in his default culture.
How can I specify the culture to get?
Here's my code:
public JsonResult<List<Retailer>> GetAll() { var retailers = new List<Retailer>(); //This shit dosen't work var lang = HttpContext.Current.RequestÂ.QueryString["lang"]; var cultureInfo = CultureInfo.GetCultureInfo(lang); Thread.CurrentThread.CurrentCulture = cultureInfo; Thread.CurrentThread.CurrentUICulture = cultureInfo; // foreach (dynamic child in Umbraco.Content(1159).Children) { retailers.Add(new Retailer() { Name = child.Name, Url = child.Url, City = child.Ville, Latitude = child.Latitude, Longitude = child.Longitude, Region = child.Region }); } return Json(retailers, _settings); }
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
API : How can I get content from other culture?
Hello community ;)
I'm triyng to get pages with the API using Umbraco.Content(xxxx).Children, but it always return the content in his default culture.
How can I specify the culture to get?
Here's my code:
is working on a reply...