I have added multinode tree view picker property on my home page and configure content and item type.
i am getting null values even i can see the count
@foreach (var item in homePage.FeaturedProducts){var media = item.Value<IPublishedContent>("image"); error null value }
i can see the values in item variable on debug mode.
Is the 'image' property on the picked nodes present on each picked FeaturedProduct?
eg does:
@foreach (var item in homePage.FeaturedProducts){
<li>@item.Name</li>
}
successfully give you a list of each picked item or error in a similar way?
If it does write out the names then does:
@foreach (var item in homePage.FeaturedProducts){
if (item.HasValue("image")) {
var media = item.Value<IPublishedContent>("image");
}}
make a difference?
and finally which version of the Media Picker are you using for the 'image' property?
The new V3 version released in 8.14 has a different syntax for accessing the property (https://our.umbraco.com/documentation.../Fundamentals/Backoffice/Property-Editors/Built-in-Property-Editors/Media-Picker-3/):
@foreach (var item in homePage.FeaturedProducts){
if (item.HasValue("image")) {
var v3PickedMedia = item.Value<MediaWithCrops>("media");
// you access the IPublishedContent item via a new MediaItem property
var media = v3PickedMedia.MediaItem;
}}
Other than that other thing might be your Internal Examine index, it may be worth rebuilding that from the developer section, and 'nucache caches' too just to rule ot anything weird.
Multinode tree view picker
Dear Experts,
I have added multinode tree view picker property on my home page and configure content and item type. i am getting null values even i can see the count
i can see the values in item variable on debug mode.
please advice
Hi Rizwan
Is the 'image' property on the picked nodes present on each picked FeaturedProduct?
eg does:
successfully give you a list of each picked item or error in a similar way?
If it does write out the names then does:
make a difference?
and finally which version of the Media Picker are you using for the 'image' property?
The new V3 version released in 8.14 has a different syntax for accessing the property (https://our.umbraco.com/documentation.../Fundamentals/Backoffice/Property-Editors/Built-in-Property-Editors/Media-Picker-3/):
Other than that other thing might be your Internal Examine index, it may be worth rebuilding that from the developer section, and 'nucache caches' too just to rule ot anything weird.
Anyway hope that helps!
regards
Marc
Dear Marc,
Thanks for solution, you are correct i am using version 8.14 and media picker3.
Thanks again
is working on a reply...