November Happy Hour will be moved to Thursday December 5th.

How to render content block?

Vote:
 

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.

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

    public EditorDropBehavior EditorDropBehaviour { get; set; }
}



#182645
Sep 27, 2017 9:27
Vote:
 

Hi,

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.

#182663
Sep 27, 2017 13:53
Vote:
 

Hi,

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?

#182665
Edited, Sep 27, 2017 14:03
Vote:
 

Hi,

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

JC

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