It's easy enough to do content.SetValue("mediapicker", media.GetUdi()) but how do you do it for multiple images?
j
Jemayn
12/16/2024, 2:14 PM
The easiest approach I've found is to create a page with a media picker, select multiple images and then save and see how that data is stored in the database (the umbracoPropertyData table).
I think in this case it is just a comma seperated list of udi's, so that would be the data format you'd need to match in your value passed to SetValue
a
Anders Bjerner
12/16/2024, 3:58 PM
The media picker doesn't just save the UDI(s) of the selected media, but a JSON array where each item should have it's own GUID key and a reference to the selected media.
), the serialized string will match the value saved by Umbraco.
s
Sander L
12/17/2024, 4:20 AM
I often take some initial inspiration of how it "should" look like, especially with references to other items, by adding multiple items to an existing page and checking the examine index