Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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!
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.
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
and by getting the int the result is correct, that's why I decided to post here instead of the Vorto forum :)
have you been able to replicate the issue?
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.
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
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
Yes, could try both methods but I don't see why, it needs the object so use ConvertSourceToObject
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.
By any chance do you have any example code showing how you mapped the Vorto value of that nested content to your properties?
I've written a blog with example code: http://24days.in/umbraco/2015/multilingual-vorto-nested-content/
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted