volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Using blocks as containers

Is it possible in EPiServer 7 to use blocks as containers? As in a a block that has no renderer just like a normal page container.

I have created a block in my site which inherits directly from EPiServer.Core.BlockData. There are no renderes at all for this block in my site.

To make sure of this, I have also changed my block preview page to be a rendered for a class above BlockData so that it should not be used for my 'container' block.

public partial class BlockPreview : PreviewPage, IRenderTemplate<SiteBlockBase>

Now in theory, there are no renders at all available for my block, however when viewing the block in EPiServer, the "Toggle preview" button is still available and on previewing, a error is thrown

Content with id '97_345' is of type 'Castle.Proxies.NewsBlockProxy' which does not inherit required type 'EPiServer.Core.PageData'

Is it possible to use blocks like this in EPiServer or should I continue using page containers to implement this type of functionality?

 

Thanks,

Adam

#71176
May 13, 2013 11:39

Hi Adam,

Can what you're trying to achieve be achieved using a block which has a property of type ContentArea? Allowing you to place other blocks within the block and render them as you choose. Or perhaps the Block Folder more what you're going for?

I may be missing something but I think one or other of those solutions would suit your needs.

Cheers,

Kev

#71200
May 13, 2013 17:33
error 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.