I have a document type with a media picker on it, multiple items, images only and no folders all turned on. I've added an image to an instance of this content item, but when trying to render the collection of items is showing as null?
cp.BlogImages is null.. Sorry, should have specified. I've taken off the "Multiple images" option and it works with a single image. As soon as it goes multiple, it breaks :|
After some experimenting.. If you have "Pick multiple items" and "Pick only images" on at the same time, the media selector always returns null. Sounds like a bug to me, unless anyone has an explination.
Media Selector Returning Null
I have a document type with a media picker on it, multiple items, images only and no folders all turned on. I've added an image to an instance of this content item, but when trying to render the collection of items is showing as null?
@inherits Umbraco.Web.Mvc.UmbracoViewPage
@using ContentModels = Umbraco.Web.PublishedModels;
@{
Layout = "";
var cp = (ContentModels.BlogPost)Umbraco.AssignedContentItem;
}
@foreach(Image blogImage in cp.BlogImages) { @blogImage.Url }
Hi Tony
cp.BlogImages
is null orcp
?cp.BlogImages is null.. Sorry, should have specified. I've taken off the "Multiple images" option and it works with a single image. As soon as it goes multiple, it breaks :|
After some experimenting.. If you have "Pick multiple items" and "Pick only images" on at the same time, the media selector always returns null. Sounds like a bug to me, unless anyone has an explination.
is working on a reply...