Consider the following page type.
[AvailableContentTypes(Availability.Specific, Include = new[] { typeof(ReactionLike), typeof(ReactionComment), typeof(NewsListPage) })]
public class NewsPage : PageData {}
And custom IContent implementations
public class ReactionLike : IContent {}
public class ReactionComment
: IContent {}
It works initially, to programmatically add content on NewsPage with AccessLevel.Read so users that can read the page can have ReactionLike
and
ReactionComment
on the page.
But, when changing something in another admin tab for this Page Type, like set the archive container, only NewsListPage is a valid member of AvailableContentTypes
.
This is obviously a bug, and either the UI should display all possible available content types
(IContent:s)
instead of only pages, OR you could add hidden fields for custom IContent that are not pages, so they are at least posted to the backend when saving Page Type changes in admin, so the definition in code isn't overwritten. OR you should re-add those non-selectables but code-defined content types in backend after posting the update.
This is a very disturbing issue that you've had for many years, that should be a very easy fix.
Product:
EPiServer CMS 11