SaaS CMS has officially launched! Learn more now.

Maciej Golis
Jan 8, 2019
  3087
(3 votes)

Image Cropper Property Editors (using ImageResizing.NET)

Happy New Year All!

There are many ways an image crop can be defined. As we know, editors do like as much flexibility as possible :) Having discussed various approaches with multiple content teams, we have decided to enable cropping at the page or block level.  

We made 2 editors available:

  • Image Reference
  • Image Reference List

The aspect ratio can be defined for each instance of the property editor individually

Usage

Image can be assigned by drag and dropping it into the drop zone:

Once the image is dropped, Image Cropper dialog is displayed:

Of course, any image can be edited or deleted at any point. Moreover images in Image Reference List editor can be reordered:

Implementation

The NuGet package is available in the EPiServer Nuget Feed. The source code and the implemenation guide can be found on GitHub.

Jan 08, 2019

Comments

Jan 8, 2019 03:26 PM

What I'd like it to be able to fix the ratio. If a shared image is being used in a block/page that's a fixed 16/9 area it would be good that the editor only supported that ratio and would mean large images could be reused across the board. Else users can still crop an image out that then when rendering through might be displayed in a different ratio

Maciej Golis
Maciej Golis Jan 8, 2019 06:46 PM

Hi Scott,

This is something that is supported out of the box. Please have a look at the code snippet below:

[ImageReference(CropRatio = (double)16/9)]
public virtual ImageReference SingleImage { get; set; }

Thanks, M

valdis
valdis Jan 9, 2019 06:31 PM

hey, this is nais that you finally packed it up as nugget :) would be cool if you could add syntax sugars for rendering picture tag as well (https://github.com/valdisiljuconoks/ImageResizer.Plugins.EPiServerBlobReader#render-picture-element).

also would be awesome to jump to StructureMap v4.x

don't take it like critisism :), I just don't have naything else to do as reviewing foreign code.. i added coupe github issues. just my old man 2 cents :)

Please login to comment.
Latest blogs
Optimizely SaaS CMS Concepts and Terminologies

Whether you're a new user of Optimizely CMS or a veteran who have been through the evolution of it, the SaaS CMS is bringing some new concepts and...

Patrick Lam | Jul 15, 2024

How to have a link plugin with extra link id attribute in TinyMce

Introduce Optimizely CMS Editing is using TinyMce for editing rich-text content. We need to use this control a lot in CMS site for kind of WYSWYG...

Binh Nguyen Thi | Jul 13, 2024

Create your first demo site with Optimizely SaaS/Visual Builder

Hello everyone, We are very excited about the launch of our SaaS CMS and the new Visual Builder that comes with it. Since it is the first time you'...

Patrick Lam | Jul 11, 2024

Integrate a CMP workflow step with CMS

As you might know Optimizely has an integration where you can create and edit pages in the CMS directly from the CMP. One of the benefits of this i...

Marcus Hoffmann | Jul 10, 2024

GetNextSegment with empty Remaining causing fuzzes

Optimizely CMS offers you to create partial routers. This concept allows you display content differently depending on the routed content in the URL...

David Drouin-Prince | Jul 8, 2024 | Syndicated blog

Product Listing Page - using Graph

Optimizely Graph makes it possible to query your data in an advanced way, by using GraphQL. Querying data, using facets and search phrases, is very...

Jonas Bergqvist | Jul 5, 2024