Skip to content

Instantly share code, notes, and snippets.

@Jeavon
Created June 6, 2014 08:10
Show Gist options
  • Save Jeavon/0bfa4c82a0dd43ff2c52 to your computer and use it in GitHub Desktop.
Save Jeavon/0bfa4c82a0dd43ff2c52 to your computer and use it in GitHub Desktop.
GetCropUrl - check for predefined and fall back if not
@{
if (feature.HasValue("Image"))
{
var featureImage = Umbraco.TypedMedia((int)feature.Image);
var myCropUrl = featureImage.GetCropUrl("PageBannerCrop") ?? featureImage.GetCropUrl(200, 100);
<a href="@feature.Url" class="image image-full"><img src="@myCropUrl" alt="" /></a>
}
}
@Jeavon
Copy link
Author

Jeavon commented Oct 29, 2014

@akeilox yes there is, hope you found the answer elsewhere already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment