Try our conversational search powered by Generative AI!

Help needed: Content type "SysContentFolder" is not allowed to be created under parent of content type "StartPage"

Vote:
 

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.

   [SiteContentType(GUID = "97b8ccd8-2975-40a7-a68f-1c7b49245a59",
        DisplayName = "Start page",
        Description = "The start page of the site")]
    [SiteImageUrl(Global.ContentTypeIconFolder + "home.png")]
    public class StartPage : ContentPageBase
    {

...}

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. 

#192379
May 16, 2018 8:36
Vote:
 

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
#192384
May 16, 2018 9:37
Vote:
 

How does the definition of the content type that is unable to be created below startpage look like?

#192386
May 16, 2018 9:42
Vote:
 

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.

#192397
May 16, 2018 11:18
* 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.