Umbraco Razor Crops - One way of checking if the Crop exists
This bit of code (highlighted yellow) writes out the Count of a cropped image as a comment, if it fails a default image is written out. @inherits umbraco.MacroEngines.DynamicNodeContext @using umbraco.cms.businesslogic.template; @using System.Xml.XPath @{ int foundMatch = 0; string outPutText = ""; foreach (var page in Model.Children) { var thisImage = page.homePageImage; var mediaItem = Model.MediaById(@thisImage); if (@mediaItem.CroppedImages.Count() > 0) { <hr /> @Html.Raw("<article class=\"\">"); <div> <div class="one_half first"> <a href="@page.Url" title="@page.navigationName"> @try { @Html.Raw("<!--" + @mediaItem.CroppedImages.Find("@name", "mediumImage").Count...