Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
A block is normally rendered as a partial. If you want to edit it on-page you need to render it with a page renderer.
See Rendering-of-content, look for the paragraph about "Preview of block during on page editing"
Hi Mark,
Thank you. It was not clear to me that only the PreviewBlockController was enough to render te block correctly.
Hi,
I haven't been able to crack this, so maybe you can help me. I have a simpel page with a content area. I also created a block (I have tried this with a Controller and through IViewTemplateModelRegistrator).
When I added the block to my content area, the block is rendered in the page, but when I try to edit the block the block cannot be rendered by EPiServer and EPiServer switches to the form mode in which I can fill in all my fields.
When I use a controller I'm using a baseclass which looks like this:
[TemplateDescriptor(Inherited = true, TemplateTypeCategory = TemplateTypeCategories.MvcPartialController)] public abstract class BaseBlockController<T> : BlockController<T> where T : SiteBlockData
When I use the IViewTemplateModelRegistrator it looks like this:
viewTemplateModelRegistrator.Add(typeof(CarouselSlideBlock), new TemplateModel { Name = "CarouselSlideBlock", Inherited = true, AvailableWithoutTag = true, Path = String.Format("~/Areas/{0}/Views/Shared/Blocks/CarouselSlideBlock.cshtml", areaName) });
Does anybody have any idea how I can fix this? It would be great if I could fix this.
Thanks in advance!