在EpiServer 11中,我想强制执行哪些块可以添加到块下的哪些文件夹中。在这篇文章之后:
这样可行,但文件夹只能是一层深度。这是我无法添加驻留在其他自定义文件夹中的任何自定义文件夹。有没有办法控制这个?
答案 0 :(得分:2)
这是由于对配置缺乏了解。这是我的文件夹:
[ContentType(DisplayName = "Settings Folder", GUID = "1422f7b1-a6aa-485f-a7f3-4049c9343f06", Description = "")]
[AvailableContentTypes(Availability.Specific, Include = new [] { typeof(SiteSettingsBlock), typeof(HeaderSettingsBlock), typeof(FooterSettingsBlock)})]
public class SettingsFolder : ContentFolder
{
}
我需要做的就是将内容文件夹添加为可用类型:
[ContentType(DisplayName = "Settings Folder", GUID = "1422f7b1-a6aa-485f-a7f3-4049c9343f06", Description = "")]
[AvailableContentTypes(Availability.Specific, Include = new [] { typeof(SiteSettingsBlock), typeof(HeaderSettingsBlock), typeof(FooterSettingsBlock), typeof(ContentFolder)})]
public class SettingsFolder : ContentFolder
{
}