Copied to clipboard

Flag this post as spam?

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


  • Urvish 252 posts 776 karma points
    Apr 24, 2015 @ 13:45
    Urvish
    0

    Multiple media(images) value not getting in Model using Ditto

    Hi,

    I have used Umbraco.MultipleMediaPicker for getting multiple images.

    When I bind that property to the Model it gives me null value.

    [UmbracoProperty("images", "images", false, null)]
     public List<string> SliderImagePathList { get; set; }
    

    It gives me null list in the controller when I cast Model using ditto.

    Can anyone help?

    Thanks in advance.

    Regards,

    Urvish Mandaliya

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Apr 24, 2015 @ 14:13
    Lee Kelleher
    1

    Hi Urvish,

    By default, the Umbraco.MultipleMediaPicker would return a string value (containing comma-separated media IDs).

    Which version of Ditto are you using? If it's 0.6.1, then you can use a built-in TypeConverter to handle the mapping.

    [TypeConverter(typeof(MultipleMediaPickerConverter<string>))]
    [UmbracoProperty("images", "images", false, null)]
    public IEnumerable<string> SliderImagePathList { get; set; }
    

    Cheers,
    - Lee

  • Urvish 252 posts 776 karma points
    Apr 24, 2015 @ 14:33
    Urvish
    0

    Hi Lee,

    Thanks for the reply.

    We are using 0.6.1 Ditto version.

    We get below error while using above code.

    enter image description here

    No list value returns.

    Regards,

    Urvish Mandaliya

  • Urvish 252 posts 776 karma points
    Apr 27, 2015 @ 07:46
    Urvish
    0

    Hi Lee,

    When we implement IEnumerable<string> and MultipleMediaPickerConverter<string> , we get the error of Children could not be evaluated.

    But IPublishedContent object have all the values of images.

    Can you please help?

    Thanks.

    Regards,

    Urvish Mandaliya

  • James Jackson-South 489 posts 1747 karma points c-trib
    May 14, 2015 @ 18:09
    James Jackson-South
    0

    I think that is due to a bug in the converter. The next release definitely has that all fixed.

  • Urvish 252 posts 776 karma points
    May 21, 2015 @ 14:06
    Urvish
    0

    Thanks James for the reply.

    Waiting for the next release.:)

    Lee, is there any plan for new relase?

    Regards,

    Urvish Mandaliya

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    May 21, 2015 @ 14:09
    Lee Kelleher
    0

    Very soon! We're testing out a new feature to make sure it is rock solid... then we'll do a v0.7.0 release.
    Hopefully early next week, (if not before) :-)

  • Urvish 252 posts 776 karma points
    May 21, 2015 @ 14:13
    Urvish
    0

    Thanks Lee for the prompt reply.

    Looking forward for the release.:)

Please Sign in or register to post replies

Write your reply to:

Draft