PiranhaCMS / piranha.core

Piranha CMS is the friendly editor-focused CMS for .NET that can be used both as an integrated CMS or as a headless API.
http://piranhacms.org
MIT License
1.99k stars 555 forks source link

Constrain the type of items added to an ArchivePage<T> #503

Closed vdecristofaro closed 5 years ago

vdecristofaro commented 5 years ago

Hello, I have created a custom ArchivePage. Something like this:

[PageType( Title = "MyArchive", UseBlocks = false )]
[PageTypeRoute(Title = "My archive", Route = "/archives/myposts")]
public class MyArchive : ArchivePage<MyArchive> {
}

then I have defined a custom post like this one

[PostType( Title = "MyPost" )]
public class MyPost : Post<MyPost> {
}

Is there any way to constrain the MyArchive container to accept only MyPost types?

filipmatsman commented 5 years ago

As of today there is no support for this. But we have talked about this before, see #276

vdecristofaro commented 5 years ago

Perfect. I will subscribe that threads then. Thanks!