Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

How to render content block?


If I change drop down behavior for instance for images to CreateContentBlock how do I code view to render this content block?

To be more precise suppose image drop to property of type XhtmlString called MainBody.

public class ImageFileUIDescriptor : UIDescriptor, IEditorDropBehavior
    public ImageFileUIDescriptor() : base(ContentTypeCssClassNames.Image)
        DefaultView = CmsViewNames.AllPropertiesView;
        EditorDropBehaviour = EditorDropBehavior.CreateContentBlock;

    public EditorDropBehavior EditorDropBehaviour { get; set; }

Sep 27, 2017 9:27


You create a display tempate for ContentReference and put it in /views/shared/DisplayTemplates/. I think this is already done in the Alloy example templates, so please have a look there.

Sep 27, 2017 13:53


I have looked there but I did not find out anything relevant. Maybe I am searching for something else then I should to.

What name should this view has got? Is it partial view or normal one? Does it have a controller?

Edited, Sep 27, 2017 14:03


that solution did not work but after creating proper view in shared folder for particular base type all works fine. Thanks for advice!


Oct 02, 2017 15:55
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.