【发布时间】:2011-01-11 11:58:28
【问题描述】:
N2中的一个页面可以添加任意数量的同一类ContentItems吗?它们可以嵌套吗?
即有没有办法将ContentItems 的集合定义为 N2 中的属性?如果可能的话,我还想嵌套这些,以便我们可以对数据运行更有意义的查询。 (即,不要使用难以查询的巨大 EditableTextRegions。)
我目前有以下模型作为“理想”,这可以 N2ified 吗? (为了清楚起见,我省略了属性和 N2 样式的 getter/setter)
public class Link : ContentItem
{
public string Text { get; set; }
public string Title { get; set; }
public string Url { get; set; }
}
public class Panel : ContentItem
{
public string Title { get; set; }
public string Text { get; set; }
public List<Link> Links { get; set; } // Should show an expandable number of “Link” editors in the CMS editor
public string ImageUrl { get; set; }
}
public class Page : ContentItem
{
public string Title { get; set; }
public string BodyText { get; set; }
public List<Panel> Panels { get; set; } // Should show an expandable number of “Panel” editors in the CMS editor
}
【问题讨论】:
标签: c# collections nested n2 n2cms