Skip to content

Latest commit

 

History

History
41 lines (23 loc) · 1.8 KB

README.md

File metadata and controls

41 lines (23 loc) · 1.8 KB

Umbraco Image Crop Picker

Build status NuGet Version

Custom proprty editor for selecting single (currently) image crop data record from customizable Image Cropper DataType.

Example usage

You need to have data type in your solution which is using Image Cropper property editor built in Umbraco. It may be default Image Cropper DataType, but also your custom one.

After installation of Our.Umbraco.ImageCropPicker you'll be able to create new DataType using Image Crop Picker property editor. You need to specify which DataType with Image Cropper you want to use in this one and from which we'll be retrieving image crops data.

Brand new DataType is ready to be used on any DocumentType created inside Umbraco solution.

Using included property value converter it's possible to retrieve property value as a strongly typed ImageCropData model delivered by default with Umbraco.

var cropPickerData = Model.Content.GetPropertyValue<ImageCropData>("cropPicker");

var alias = cropPickerData.Alias;
var width = cropPickerData.Width;
var height = cropPickerData.Height;
var coordinates = cropPickerData.Coordinates;

Installation

NuGet package repository

To install from NuGet, you can run the following command from within Visual Studio:

PM> Install-Package Our.Umbraco.ImageCropPicker