Grzegorz Wiecheć
Nov 5, 2018
  10005
(14 votes)

Improved image property

In Episerver 11.12.0 we have improved the image property. The property content selector now offers the same functionality as the Media Component that you have in the assets pane.

 

Uploading images

One often requested CMS feature is the possibility to upload new images without having to close dialog. This functionality is now available in the new property. Editors can upload images using an "Upload files" button or drop the images directly from their computer.

Content actions

The media selector has much more useful features comparing to the standard content tree widget, which can be used when selecting an image. Editors can change the folder structure, download and edit images, etc. All functionalities of the media component are available.

Using new image property

To show the image property in edit view the "Image" UIHint should be used.

public class ProductPage: PageData
{
        [UIHint(UIHint.Image)]
        public virtual ContentReference PageImage { get; set; }
}

This is the same key that was used for the old image property which means that new property will replace the old one without any code changes.

Support for other media types

The new property can be also used to select other media types, for example, videos. To add a new video property, the "Video" UIHint can be used:

public class ProductPage : PageData
{
        [UIHint(UIHint.Video)]
        public virtual ContentReference Video { get; set; }
}

Displaying media types that don't have an explicit UIHint is controlled by the AllowedTypes attribute. For example, if the site has PDF files and they should be selected in ContentReference property, the code should look like this:

public class ProductPage : PageData
{
        [UIHint(UIHint.MediaFile)]
        [AllowedTypes(typeof(PdfData))]
        public virtual ContentReference Video { get; set; }
}
Nov 05, 2018

Comments

Nov 5, 2018 04:27 PM

Good work, I've just removed the addtions to make this work before and upgraded. All working for me :-)

Henrik Fransas
Henrik Fransas Nov 6, 2018 07:39 AM

Great news and great work as always!

Thanks!

Nov 6, 2018 07:44 AM

Oooh nice!

Peter Gustafsson
Peter Gustafsson Nov 7, 2018 12:51 PM

Excellent stuff!

A very welcome feature.

-- This comment has been filtered by Sarcasm-detector-bot-v3.2

Henrik Fransas
Henrik Fransas Dec 7, 2018 08:15 AM

This is so great and one of the first time I have heard editors pretty much scream out "YES!!"

Muhammad Kashif
Muhammad Kashif Jul 21, 2019 10:30 PM

Hi Grzegorz -  it looks really cool but having an issue to specfiy custom 'Roots' for images folders . In previous Content selection editor we were specifying the custom root folder by overriding Roots property of EditorDescriptor but now it no longer seems to work - I've tried by overriding both  ImageReferenceEditorDescriptor and ContentReferenceEditorDescriptor and it always ignores 'Roots'. Could this be please looked at?

Please login to comment.
Latest blogs
Optimizely Forms: You cannot submit this form because an administrator has turned off data storage.

Do not let this error message scare you, the solution is quite simple!

Tomas Hensrud Gulla | Oct 4, 2024 | Syndicated blog

Add your own tools to the Optimizely CMS 12 admin menu

The menus in Optimizely CMS can be extended using a MenuProvider, and using the path parameter you decide what menu you want to add additional menu...

Tomas Hensrud Gulla | Oct 3, 2024 | Syndicated blog

Integrating Optimizely DAM with Your Website

This article is the second in a series about integrating Optimizely DAM with websites. It discusses how to install the necessary package and code t...

Andrew Markham | Sep 28, 2024 | Syndicated blog

Opticon 2024 - highlights

I went to Opticon in Stockholm and here are my brief highlights based on the demos, presentations and roadmaps  Optimizely CMS SaaS will start to...

Daniel Ovaska | Sep 27, 2024

Required fields support in Optimizely Graph

It's been possible to have "required" properties (value must be entered) in the CMS for a long time. The required metadata haven't been reflected i...

Jonas Bergqvist | Sep 25, 2024

How to write a bespoke notification management system

Websites can be the perfect vehicle for notifying customers of important information quickly, whether it’s the latest offer, an operational message...

Nicole Drath | Sep 25, 2024