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
Hi, on the homepage of my Umbraco v8 website I want to show a list of childnodes from a given parentnode, these items are jobopenings.
Each of those childnodes have a property of the type Media.
I am having a hard time displaying the image of the childnode.
This is what I've tried so far:
var jobOpenings = Umbraco.Content(Guid.Parse("09fdad92-488c-474f-a8d9-77dfe5f4bd65"))
.Where(x => x.IsPublished())
.Where(x => x.IsVisible())
.Where(x => x.HasProperty("showOnHomepage"))
.Where(x => (bool)x.GetProperty("showOnHomepage").Value())
.OrderByDescending(x => x.CreateDate);
foreach (var jobOpening in jobOpenings)
//Title shows up
//The following two lines both result in the text "Umbraco.Web.PublishedModels.Image"
What is the correct way to show the image?
Okay so I would do something like this
//This is using Models builder models by the way
foreach(JobOpening jobOpening in jobOpenings)
if(jobOpening.Image != null)
//Alternatively use .GetCropUrl() instead of .Url and specify the crop to display
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted