AI OnAI Off
You could use the AvailableContentTypes attibute on your ContentModel classes to define which models that should be availble under that model, like following from Alloy:
[AvailableContentTypes( Availability.Specific, Include = new[] { typeof(ContainerPage), typeof(ProductPage), typeof(StandardPage), typeof(ISearchPage), typeof(LandingPage), typeof(ContentFolder) }, // Pages we can create under the start page... ExcludeOn = new[] { typeof(ContainerPage), typeof(ProductPage), typeof(StandardPage), typeof(ISearchPage), typeof(LandingPage) })] // ...and underneath those we can't create additional start pages public class StartPage : SitePageData
How does the definition of the content type that is unable to be created below startpage look like?
Thanks for the responses, Henrik the type that isnt allowed is an inbuilt system type.
// // Summary: // /// Represents a folder in a content tree. A content folder is used to structure // content and has no visual appearance on the site. /// [AdministrationSettings(GroupName = "systemtypes", Visible = true, CodeOnly = true, Order = 10000)] [DebuggerDisplay("{DebuggerDisplay,nq}")] public class ContentFolder : BasicContent, IReadOnly<ContentFolder>, IReadOnly, IContentSecurable, ISecurable, IRoutable { }
Thanks Johan we'll try explicitly adding the system type page as allowed.
We have also found that in Epi Admim under "StartPage", we've just set allow all on content types and this seems to resolve it, however this approach feels more like a work around.
Hi, We are resonably new to Episerver and have taken of a new project that was recently built for us.
We keep getting stuck when trying to either copy and paste a site or import a site we have created in our instance.
The following errors have occurred:
[Importing content 255_622] Exception: Content type "SysContentFolder" is not allowed to be created under parent of content type "StartPage"
StartPage is a custom class, definition below.
We have also tried manually adding the maping betweem types in the "tblContentTypeToContentType" table. However after a code deploy it looks like epi server refreshes this to match what is defined in the code. Leaving us with the same issue.
Is there a way to explicitly allow SysContentFolder under a custom page type? Any assistance here would be greatly appreciated.