Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tony Cheetham 24 posts 134 karma points
    Mar 05, 2019 @ 12:44
    Tony Cheetham
    0

    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 }

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Mar 05, 2019 @ 13:52
    Alex Skrypnyk
    1

    Hi Tony

    cp.BlogImages is null or cp ?

  • Tony Cheetham 24 posts 134 karma points
    Mar 05, 2019 @ 14:08
    Tony Cheetham
    0

    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 :|

  • Tony Cheetham 24 posts 134 karma points
    Mar 05, 2019 @ 14:22
    Tony Cheetham
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft