Last active
May 26, 2017 16:58
-
-
Save naepalm/ef62771d72af15b9f337307eec01b4d1 to your computer and use it in GitHub Desktop.
A simple example of how to use the Zoom Area Cropper in a view.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits UmbracoTemplatePage | |
@using ZoomAreaCropper.Models | |
@{ | |
Layout = null; | |
} | |
@if (Model.Content.HasValue("photo")) | |
{ | |
var photo = Model.Content.GetPropertyValue<ZoomAreaCropper>("photo"); | |
if (photo.HasMedia) | |
{ | |
@* Displays the original image as IPublished Content *@ | |
<img src="@photo.Media.Url" /> | |
} | |
if (photo.HasCrops) | |
{ | |
foreach (var crop in photo.Crops) | |
{ | |
if (crop.IsValid) | |
{ | |
@* Displays pre-cropped images based on the original media items using ImageProcessor *@ | |
<img src="@crop.Url" /> | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment