However I've also added a custom Dropdown list property to the default Image media type called captionBackgroundColour. If I try to access the property using @item.CaptionBackgroundColour I get Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'CaptionBackgroundColour' and no extension method 'CaptionBackgroundColour' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
Can anyone offer a steer on where I'm going wrong?
Accessing custom properties of a media type in Razor
Hi
I'm attempting my first production Umbraco website (7.6.4) and have a document type which includes a Media Picker for creating a Image slider.
Based on the Typed Example code for Media Picker I've got the following code working to display the images in the template.
However I've also added a custom Dropdown list property to the default Image media type called captionBackgroundColour. If I try to access the property using
@item.CaptionBackgroundColour
I getUmbraco.Core.Models.IPublishedContent' does not contain a definition for 'CaptionBackgroundColour' and no extension method 'CaptionBackgroundColour' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
Can anyone offer a steer on where I'm going wrong?
is working on a reply...