SaaS CMS has officially launched! Learn more now.

Custom rendering of images added in XHtmlString

Vote:
 

Hi,

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

#89977
Aug 29, 2014 13:53
Vote:
 

Hi,

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.

#89982
Aug 29, 2014 18:42
Vote:
 
#90141
Sep 02, 2014 21:40
Vote:
 

Anyone managed to solve this :)?

#176577
Mar 22, 2017 11:40
Vote:
 

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

#176580
Mar 22, 2017 12:49
Vote:
 

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


What i missed was UIDescriptor<ImageFile> :

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

public ArticlePageDescriptor()
{
EditorDropBehaviour = EditorDropBehavior.CreateContentBlock;
}
}

thanks!

#176582
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.