1
的我申请一个数据源到sublayout并获得如下其孩子的价值观:Sitecore的儿童数据源
Sitecore.Collections.ChildList childItems;
if (Sitecore.Context.Database.GetItem(this.DataSource) != null)
{
childItems = Sitecore.Context.Database.GetItem(this.DataSource).GetChildren();
}
else
{
litDataSourceError.Text += "You need to set a datasource";
}
foreach (Item item in childItems)
{
litDataSourceError.Text += "<h2>" + item.Fields["Title"].Value + "</h2>";
}
这是预期但这些项目也有孩子,我想输出工作。
所以我的问题是如何在我的ForEach内部查看更多的节点来获得儿童儿童 - 只会有这两个层次的结构。
是有道理谢谢你的建议,我会采取这种做法。 – user3779703