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
I can add that the interface needs to implement IContentData to be able to handle both pages as well as shared blocks.
Hi,
I have a content area that uses an interface to restrict that content can be added to it. The restriction is to a marker interface that's defined on both a page type and a block type. There no documentation that describes any restrictions to what the interface has to implement in the documentation as far as I can tell:
https://world.episerver.com/documentation/developer-guides/CMS/Content/Properties/built-in-property-types/Restricting-content-types-in-properties/
However, whe I search for the error I'm getting I found a thread where Casper Rasmussen say that the interface has to implement IContent. If that's the case, it should be mentioned in the documentation (the page above). However - a quite common case is that you want to allow either a page or a block that implements a given interface. Since the code for blocks don't implement IContent (this is implemented in the wrapping instance in Episerver) I don't know if this is possible.
I should mention that the content area works in general - you can always drag and drop content into it - but since I got a test report of this error I thought that I should investigate it.