I have an issue with getting the values of custom properties, after retrieving an IPublishedContent with a specific culture.
I have a workaround for it right now, but there should be a better way of handling it.
I have a Surfacecontroller that looks something like this:
public ActionResult Filter(int id, string json)
{
var page = Umbraco.Content(id);
var culture = "da";
HomePage homePage = new HomePage(page);
var MyClasses = (IEnumerable<IPublishedContent>)homePage.Value("MyCustomListProperty",culture);
foreach(var myClass in MyClasses){
var prop = myClass.CustomProperty; //this gives the value from the default culture
var propReal = myClass.Value("CustomProperty",culture);//This gives the correct value
}
...
}
i can get the correct prop value using myClass.value and provide the culture, but that should be redundant as i retrieved the list specifying the culture.
I', certain this has worked before, where "prop" would get the real value, but can't figure out how or why it stopped working.
Custom properties are empty
I have an issue with getting the values of custom properties, after retrieving an IPublishedContent with a specific culture.
I have a workaround for it right now, but there should be a better way of handling it.
I have a Surfacecontroller that looks something like this:
i can get the correct prop value using myClass.value and provide the culture, but that should be redundant as i retrieved the list specifying the culture. I', certain this has worked before, where "prop" would get the real value, but can't figure out how or why it stopped working.
Any help on why the properties behave like this ?
is working on a reply...