[英]Using EditableChildren in N2CMS
When I using the EditableChildren in N2CMS(ver 2.7.5), in a model page, I getting the error " Cannot add any parts due to zone/user/type restrictions ". 当我在N2CMS(版本2.7.5)中使用EditableChildren时,在模型页面中,出现错误“ 由于区域/用户/类型限制而无法添加任何零件 ”。 I have try everything.
我已经尝试了一切。
See code below: 参见下面的代码:
[EditableChildren(Title = "Reviews list", ContainerName = CustomTabs.Review)]
public virtual IList<ReviewItem> ReviewItemsList
{
get
{
return new ItemList<ReviewItem>(Children);
}
}
Any idea? 任何想法?
You need to specify the AvailableZone as per https://github.com/n2cms/n2cms/blob/master/src/Mvc/MvcTemplates/Models/Pages/FaqList.cs : 您需要根据https://github.com/n2cms/n2cms/blob/master/src/Mvc/MvcTemplates/Models/Pages/FaqList.cs指定AvailableZone:
[PageDefinition("FAQ",
Description = "A list of frequently asked questions with answers.",
SortOrder = 200,
IconClass = "fa fa-question-circle")]
[AvailableZone("Questions", "Questions")]
[RestrictParents(typeof (IStructuralPage))]
public class FaqList : ContentPageBase, IStructuralPage
{
[N2.Details.EditableChildren("Questions", "Questions", 110, ContainerName = Tabs.Content)]
public virtual IList<Faq> Questions
{
get { return GetChildren<Faq>("Questions"); }
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.