Trying to get the image file link rather than array...
Folks,
When getting a media type from one of those fields, this is what I tried, and I am just getting back some sort of struct, and I just need to know how to pull the "src" from it. Any thoughts (aside from, who is this guy?)?
var mediaItem = Umbraco.TypedMedia(@sponsor.Value.GetPropertyValue("imageFile"));
I just needed to use the referenced media item, and use the .Url property. I find it a bit odd, because object clearly uses "src" as a label for the field I want. A bit counter intuitive, that's all.
Trying to get the image file link rather than array...
Folks,
When getting a media type from one of those fields, this is what I tried, and I am just getting back some sort of struct, and I just need to know how to pull the "src" from it. Any thoughts (aside from, who is this guy?)?
var mediaItem = Umbraco.TypedMedia(@sponsor.Value.GetPropertyValue("imageFile"));
It gives me the attached screenshot within the resulting HTML.
And so, I figured it out after tons of trial and error. For those looking for the answer, here it is:
I just needed to use the referenced media item, and use the .Url property. I find it a bit odd, because object clearly uses "src" as a label for the field I want. A bit counter intuitive, that's all.
Thanks, and happy coding! Jason
is working on a reply...