The property BannerBackgroundImage of type media picker apperantly returns a collection??
When I go the the Media Picker data type and I check the option, "Pick multiple items", save it, uncheck it and save it again then the media picker property won't return a collection but instead a single (dynamic) Umbraco.Web.Models.PublishedContentWithKeyBase which should be casted to IPublisheContent.
So the
var image = Umbraco.TypedMedia( ( int )CurrentPage.BannerBackgroundImage.Id );
Shoud be
IPublishedContentimage = Umbraco.TypedMedia( ( int )CurrentPage.BannerBackgroundImage.Id );
Otherwhise calls to GetPropertyValue() and GetCropUrl() ... throw an exception: 'Umbraco.Web.Models.PublishedContentWithKeyBase' does not contain a definition for 'GetCropUrl'
What is also strange is that the call image.GetPropertyValue( "umbracoWidth" ); returns a string now instead of an integer. Any idea why this is changed in Umbraco 7.5?
'Umbraco.Web.Models.DynamicPublishedContentList' does not contain a definition for 'Id'
This code worked perfectly fine in Umbraco 7.3.
BannerBackgroundImage is of data type Media Picker.
In a clean Umbraco 7.5.4 install I get the following Exception (RuntimeBinderException).
'Umbraco.Web.Models.DynamicPublishedContentList' does not contain a definition for 'Id'
Umbraco.ModelsBuilder.Enable is set to false in the web.config.
How should I solve this?
Thanks! Gert.
Hi,
The property BannerBackgroundImage of type media picker apperantly returns a collection??
When I go the the Media Picker data type and I check the option, "Pick multiple items", save it, uncheck it and save it again then the media picker property won't return a collection but instead a single (dynamic) Umbraco.Web.Models.PublishedContentWithKeyBase which should be casted to IPublisheContent.
So the
Shoud be
Otherwhise calls to GetPropertyValue() and GetCropUrl() ... throw an exception: 'Umbraco.Web.Models.PublishedContentWithKeyBase' does not contain a definition for 'GetCropUrl'
What is also strange is that the call image.GetPropertyValue( "umbracoWidth" ); returns a string now instead of an integer. Any idea why this is changed in Umbraco 7.5?
Regards, Gert.
is working on a reply...