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
New to Umbraco and I started using Nested Content. It's really convenient!
I am able to render strings, but not images from the content/doc types. It shows the value as null even though I've put an image in the BackOffice. Would love if there is something obvious I'm missing.
Here's the code:
IEnumerable<IPublishedContent> items = Umbraco.AssignedContentItem.GetPropertyValue<IEnumerable<IPublishedContent>>("showProducts");
foreach (var item in items)
string title = item.GetPropertyValue<string>("productName");
string price = item.GetPropertyValue<string>("price");
var photo = item.GetPropertyValue<IPublishedContent>("photos");
//<img src="@(Umbraco.AssignedContentItem.GetPropertyValue<IPublishedContent>("photos").Url)" />
<img src="@photo.Url" height="200" width="200" alt="@item.Name"/>
I've tried a few other ways to no avail. I feel I'm missing something in terms of the connection to the images uploaded in nested content for the specific current page.
What do you get when you output @photo.Name ?
And is the "photos" the correct property type alias. And what picker are you using ?
I fixed it!
Turns out it had everything to do with the Media Picker. I disabled multiple image uploads and it worked like a charm!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted