0

当我在 N2CMS(版本 2.7.5)中使用 EditableChildren 时,在模型页面中,我收到错误“由于区域/用户/类型限制而无法添加任何部件”。我已经尝试了一切。

请参见下面的代码:

 [EditableChildren(Title = "Reviews list", ContainerName = CustomTabs.Review)]
        public virtual IList<ReviewItem> ReviewItemsList
        {
            get
            {
                return new ItemList<ReviewItem>(Children);
            }
        }

任何想法?

4

1 回答 1

1

您需要根据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"); }
    }
}
于 2015-08-26T19:45:10.550 回答