My document type has some properties of type media picker. They are custom media types but I'm only interested in the standard properties provided by MediaFile.
I've got the following in my model:
public MediaFile ImageCover { get; set; }
I was hoping it would map the media node ID to a MediaFile instance but it just returns null.
Should this work or do I need to create a custom mapping?
Would be quite nice if that did just work I agree... will give it some thought. But for now it'll need a custom mapping yes - Umbraco Mapper needs to be told how to map a given complex type like this.
As I said, this seemed a good idea for something that should just work by default, so I've added support for this. If you'd like to take a look at version 1.6.1 from NuGet, our or GitHub you should find this works without having to add a custom mapping.
Do let me know please if you try this and spot any issues, but looks OK in my tests.
Mapping Media Picker
Hi,
My document type has some properties of type media picker. They are custom media types but I'm only interested in the standard properties provided by MediaFile.
I've got the following in my model:
I was hoping it would map the media node ID to a MediaFile instance but it just returns null.
Should this work or do I need to create a custom mapping?
Would be quite nice if that did just work I agree... will give it some thought. But for now it'll need a custom mapping yes - Umbraco Mapper needs to be told how to map a given complex type like this.
As I said, this seemed a good idea for something that should just work by default, so I've added support for this. If you'd like to take a look at version 1.6.1 from NuGet, our or GitHub you should find this works without having to add a custom mapping.
Do let me know please if you try this and spot any issues, but looks OK in my tests.
Andy
Hi Andy,
I've tested this and it works perfectly. Many thanks for adding this.
Richard
is working on a reply...