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
I am having trouble pulling in an image with the property of "featuredImage" from the docType of "NewsArticle". What am I doing wrong?
@{ var articles = Model.AncestorOrSelf("NewsHome").Descendants("NewsCategory").Children.Where("NodeTypeAlias == \"DateFolder\""); } @{ <ul class="featured-listings"> @foreach (var item in articles.OrderBy("CreateDate descending").Skip((page - 1) * pageSize).Take(pageSize)) { var newsCategory = @item.AncestorOrSelf("NewsCategory"); <li class="listing"> <p class="tag">@newsCategory.Name - @item.CreateDate.ToShortDateString()</p> @if( @item.HasValue("featuredImage")){ var featuredImageThumb = @Model.Media("featuredImage"); <img src="/[email protected]&width=154" /> } <h3><a href="@item.Url">@item.headline</a></h3></li> <p class="teaser">@item.teaser</p> } </ul> }
Hi Steve,
You should use it like this in your loop:
var featuredImageThumb = Umbraco.Media("featuredImage"); <img src="/[email protected]&width=154" />
I would use the ImageCropper if you need to create a thumbnail it's awesome.
I got it working with @item.Media("featuredImage")';
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get Image from Mediapicker
I am having trouble pulling in an image with the property of "featuredImage" from the docType of "NewsArticle". What am I doing wrong?
Hi Steve,
You should use it like this in your loop:
I would use the ImageCropper if you need to create a thumbnail it's awesome.
I got it working with @item.Media("featuredImage")';
is working on a reply...