SaaS CMS has officially launched! Learn more now.

Custom rendering of images added in XHtmlString



Is it possible to add a custom rendering view for images when they are added through the XHtmlString property?

With custom I mean through controller or directly to a DisplayTemplate.

/ Thanks

Aug 29, 2014 13:53


It's possible. However content is rendered as block elements inside TinyMCE, so you can't add them inside e.g. a paragraph or float them to the left.

In Webform you inherit from ContentControlBase and set the type to your image content data type, e.g. ImageData.

Aug 29, 2014 18:42
Sep 02, 2014 21:40

Anyone managed to solve this :)?

Mar 22, 2017 11:40

Goaral, I didn't hear anything more from Andreas, have you looked at the links I provided?

Mar 22, 2017 12:49

Yeah actually the two combined helper me out now :).

What i missed was UIDescriptor<ImageFile> :

public class ArticlePageDescriptor : UIDescriptor<ImageFile>, IEditorDropBehavior
public EditorDropBehavior EditorDropBehaviour { get; set; }

public ArticlePageDescriptor()
EditorDropBehaviour = EditorDropBehavior.CreateContentBlock;


Mar 22, 2017 13:05
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.