Image Data Preview


Hi All,

I've trying to switch default property preview for a custom one. I followed this article:

For some reason I created a custom view for the preview. Once compiled and run it is not being picked up by the CMS. Instead the default preview is not displaying a preview any more:

I am very quite new to the platform - must be something very lame!

Many thanks,


Oct 31, 2015 12:34


Could you show your code? And give more details what would you like to implement?

Oct 31, 2015 16:13


I would like to use it to as a page where the custom image cropping tool will be located.

In terms of the code, I followed the documentation (link in the previous post):

[TemplateDescriptor(Default = true, Tags = new[] { RenderingTags.Preview })]
public partial class ImageFilePreview : PreviewPage, IRenderTemplate<ImageFile>


Thanks, M

Edited, Oct 31, 2015 21:35

As far as I remember (could be wrong) Media data preview handler is responsible for this. It has following attributes set:

[TemplateDescriptor(AvailableWithoutTag = false, Inherited = true, TagString = "Preview", TemplateTypeCategory = TemplateTypeCategories.HttpHandler)]
public class ImagePreviewHandler : MediaPreviewHandlerBase, IRenderTemplate<IContentImage>, IRenderTemplate
Nov 03, 2015 23:19

This is how we've solved it for a generic file in a project. Guess it should work for image as well.

        Inherited = true,
        AvailableWithoutTag = false,
        Tags = new[] { RenderingTags.Edit },
        TemplateTypeCategory = TemplateTypeCategories.MvcController,
        Path = "/Views/GenericMedia/Index.cshtml"
    public class GenericMediaController : ActionControllerBase, IRenderTemplate<GenericMedia>
        public ActionResult Index(GenericMedia currentBlock)
            return View(currentBlock);
Nov 04, 2015 9:16
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.