Copied to clipboard

Flag this post as spam?

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


  • marcelh 171 posts 471 karma points
    Feb 21, 2017 @ 08:09
    marcelh
    0

    Using multiple media picker in the grid editor

    I must be overlooking the obvious. In Umbraco 7, there is the Umbraco.MultipleMediaPicker that can be configured in single/multiple picker mode and allowing only images to be picked.

    I would like to use the multiple item picking (but only images) functionality of this picker inside the grid editor, to add multiple images to a row configuration. I haven't found this option available when I look at the preconfigured editors that come with the Fanoe starter kit.

    Has anyone got the multiple item picking using the media picker working inside the grid editor?

  • Jonas Nikolajsen 17 posts 103 karma points
    Feb 21, 2017 @ 08:36
    Jonas Nikolajsen
    0

    Hello Marcelh

    I do like this

    @foreach (var image in Model.Items.First().GetValue<IEnumerable<IPublishedContent>>("images"))
        {
            var img = image.Id;
    
            <div class="col-xs-6 col-sm-3 item">
                <a href="@Umbraco.TypedMedia(img).GetCropUrl(1024,0)" data-lightbox="galleri"><img class="img-responsive" src="@Umbraco.TypedMedia(img).GetCropUrl(400,400)" alt="galleri" /></a>
            </div>
        }
    

    and i use Umbraco Core Property Value Converters thats why

    <IEnumerable<IPublishedContent>>
    

    :)

  • marcelh 171 posts 471 karma points
    Feb 21, 2017 @ 08:39
    marcelh
    0

    Thanks for commenting, Jonas. I can figure out the rendering, but how do I enable selecting multiple items in the editor configuration (in a manifest or grid.editors.config.js)?

  • Jonas Nikolajsen 17 posts 103 karma points
    Feb 21, 2017 @ 08:55
    Jonas Nikolajsen
    0

    you need to set a max number in you editor http://prntscr.com/ebglhg

    then you can have multiple

    and you loop like this

    @foreach (var item in Model.Items) { @item.GetValue("title") }

  • marcelh 171 posts 471 karma points
    Feb 21, 2017 @ 09:38
    marcelh
    0

    Where did you get these configuration options? Or can you share your editor's config from the manifest or grid.editors.config?

  • Jonas Nikolajsen 17 posts 103 karma points
    Feb 21, 2017 @ 09:53
  • marcelh 171 posts 471 karma points
    Feb 21, 2017 @ 09:59
    marcelh
    1

    Ah, you're cheating and using LeBlender editor (which is great!) ;-)

    I was looking for a solution without LeBlender, that is supported with a plain vanilla Umbraco installation.

  • Jonas Nikolajsen 17 posts 103 karma points
    Feb 21, 2017 @ 10:03
    Jonas Nikolajsen
    0

    Oh sry :) but i think this is the only thing you can do.

Please Sign in or register to post replies

Write your reply to:

Draft