I have a 'feature box' archetype which has a title, desc, and url picker - works fine when I pick content, i.e. i can retrieve the url property from the picker, however, when I choose media, the url is always null.
btw, I'm using this in the context of the hybrid framework.
Any pointer appreciated - I have tried deleting my indexes etc as i'm aware of issue with umbraco.typedmedia and corrupted indexes but still no joy
Thanks, I'm using the code below to get the data from the widget - it works for type=content (looking at the json I can see the fields populated correctly) but when I choose media, the url is always null. I thought it might be my indexes, so I reset iis and cleared the temp folder and rebuilt but no joy - I'll check the TypedMedia()
private IEnumerable<RelatedItem> GetRelatedImages()
{
//get user selected related images
var archetypeModel = CurrentPage.GetPropertyValue<ArchetypeModel>("relatedPhotos");
if (archetypeModel == null || !archetypeModel.Fieldsets.Any()) return null;
return archetypeModel.Select(x => new RelatedItem()
{
Title = x.GetValue<string>("title"),
Description = x.GetValue<string>("description"),
Image = x.GetValue<Image>("image"),
Url = x.GetValue<UrlPicker.Umbraco.Models.UrlPicker>("link").Url
}).ToList();
}
Imulus.UrlPicker Url always null for Media
This has been driving me nuts all day!
I have a 'feature box' archetype which has a title, desc, and url picker - works fine when I pick content, i.e. i can retrieve the url property from the picker, however, when I choose media, the url is always null.
btw, I'm using this in the context of the hybrid framework.
Any pointer appreciated - I have tried deleting my indexes etc as i'm aware of issue with umbraco.typedmedia and corrupted indexes but still no joy
Hello,
Do you have some code you can share so we can see what might be the problem? If you just use Umbraco.TypedMedia(id) you do get the media back?
Jeroen
hi
Thanks, I'm using the code below to get the data from the widget - it works for type=content (looking at the json I can see the fields populated correctly) but when I choose media, the url is always null. I thought it might be my indexes, so I reset iis and cleared the temp folder and rebuilt but no joy - I'll check the TypedMedia()
is working on a reply...