I want to use the content picker or the MNTP to choose a item with several images which is picked using the multiple media picker. I can't figure out how to show the images.
I use this code which renders out the folder where the images are located. (Remember the images is not made as children to this folder, but picked with the multiple media picker.)
@{ if (CurrentPage.HasValue("contentPicker")){ var node = Umbraco.Content(CurrentPage.contentPicker); <a href="@node.Url">@node.Name</a> } }
If I understand you´re setup correct then you have a node where you have a multiple media picker, where you pick different images. And then on another node you are choosen the item, by a content picker. If so I think something like this should work for you.
@{ if (CurrentPage.HasValue("contentPicker")){ var node = Umbraco.Content(CurrentPage.contentPicker);
if (node.HasValue("multipleMediaPicker")){ var imagesList = node.multipleMediaPicker.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); var imagesCollection = Umbraco.Media(imagesList);
Show images with content picker or MNTP
Hi,
I want to use the content picker or the MNTP to choose a item with several images which is picked using the multiple media picker. I can't figure out how to show the images.
I use this code which renders out the folder where the images are located. (Remember the images is not made as children to this folder, but picked with the multiple media picker.)
Thanks in advance!
// René
Hi René
If I understand you´re setup correct then you have a node where you have a multiple media picker, where you pick different images. And then on another node you are choosen the item, by a content picker. If so I think something like this should work for you.
Remember to change the aliases so it match your case. Try too see this documentation about using the multiple media picker https://our.umbraco.org/documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors-v7/Media-Picker
Hope this helps,
/Dennis
Hi Dennis,
I know that it is a little late to answer. :-)
Once again you solved my problem.
Thanks!
// René
is working on a reply...