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
Well, I have a problem like my Umbraco platform, I am trying to create a content blog and I want to show the header image and it doesn't show up.
<header class="major special">
I am trying to call the image node in the template and tried anyway to form and it doesn't work for me.
What sort of property is your image property? This influences how best to access it.
Assuming that the ArticleImage property on your blog post is a media picker you should be able to do the following:
<img src="@(Model.Value<IPublishedContent>("ArticleImage").Url)" />
This would get you the raw Url for the selected media it.
However, this could error if the media was later deleted. A more robust approach would be:
var articleImage = Model.Value<IPublishedContent>("ArticleImage");
if(articleImage != null)
<img src="@articleImage.Url" />
You alsomight want to consider using ImageProcessor to render a specific crop of the uploaded image by using .GetCropUrl("cropAlias") instead, where cropAlias is the alias of a pre-defined crop of the dimensions you require.
If you aren't using a media picker for this property type, let us know and we can try and help further :-)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted