Copied to clipboard

Flag this post as spam?

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


  • Alessandro Calzavara 32 posts 144 karma points c-trib
    Jul 28, 2015 @ 08:23
    Alessandro Calzavara
    0

    Problem with Multiple Media Picker inside Vorto and value converter

    Hello Leopold, I tried to get the values out of a Vorto of Mutiple Media Picker by using

    IEnumerable<IPublishedContent> mediaList  = Model.Content.GetVortoValue<IEnumerable<IPublishedContent>>("imagesPicker");
    

    but the conversion seems to fail (returns null);

    The only way I've found to get out my values was the old way,

    int[] mediaIdList = Model.Content.GetVortoValue<int[]>("imagesPicker");
    

    and then using Umbraco.Media;

    Do you have any clues about it? Thanks!

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jul 28, 2015 @ 09:56
    Jeavon Leopold
    1

    Hi Alessandro,

    I've not tried this but I know Vorto returns null if the culture doesn't match, have you checked the culture on the rendering node matches the populated Vorto language?

    Let me know if it all looks fine and I'll see if I can reproduce your issue to find out what's wrong.

    Jeavon

  • Alessandro Calzavara 32 posts 144 karma points c-trib
    Jul 28, 2015 @ 10:10
    Alessandro Calzavara
    0

    Yes, I've also already tried to force Vorto by passing the culture by hand (as a string) but the issue is still the same

    [edit]and by getting the int[] the result is correct, that's why I decided to post here instead of the Vorto forum :)

    Thanks!

  • Alessandro Calzavara 32 posts 144 karma points c-trib
    Aug 07, 2015 @ 11:53
    Alessandro Calzavara
    0

    Hello,

    have you been able to replicate the issue? thanks.

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Aug 25, 2015 @ 10:57
    Jeroen Breuer
    0

    Hello,

    I created my own value converter for the media picker, but in the GetPropertyValueType method the PropertyTypeAlias property on the propertyType object is null. Looks like Vorto creates a dummy propertytype which doesn't have that value. Might be related to why it also isn't working with the Umbraco Core Property Value Converters.

    Jeroen

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Aug 25, 2015 @ 11:10
    Jeavon Leopold
    0

    I think Vorto should be calling ConvertSourceToObject instead of ConvertDataToSource, that would probably be the issue...? https://github.com/mattbrailsford/Vorto/blob/master/Src/Our.Umbraco.Vorto/Extensions/IPublishedContentExtensions.cs#L149

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Aug 25, 2015 @ 11:21
    Jeroen Breuer
    0

    Hmm yes it seems that is the problem. It should probably work the same as Archetype where it tries both methods: https://github.com/imulus/Archetype/blob/ec8df1d4659934e484eb368a610277cab73952d6/app/Umbraco/Umbraco.Archetype/Models/ArchetypePropertyModel.cs#L72-L84

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Aug 25, 2015 @ 11:24
    Jeavon Leopold
    0

    Yes, could try both methods but I don't see why, it needs the object so use ConvertSourceToObject

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Aug 25, 2015 @ 12:13
    Jeroen Breuer
    1

    For now I found a nice workaround. Vorto and Nested Content work together pretty well. So you could create a Nested Content fieldset (min and max items both at 1) and create a Vorto datatype that has the Nested Content datatype inside.

    Everything that goes through the Nested Content does work. So I added the image and other properties to Nested Content and now everything works. It even looks a bit nicer because all the properties are inside 1 Vorto property.

    enter image description here

    Jeroen

  • Ryan Rueckl 17 posts 74 karma points
    Nov 18, 2015 @ 17:22
    Ryan Rueckl
    0

    Hi Jeroen,

    By any chance do you have any example code showing how you mapped the Vorto value of that nested content to your properties?

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Dec 10, 2015 @ 08:39
    Jeroen Breuer
    1

    Hello,

    I've written a blog with example code: http://24days.in/umbraco/2015/multilingual-vorto-nested-content/

    Jeroen

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies