在Sitecore CMS .NET中递归获取子项

Kyl*_*yle 3 sitecore

有谁知道如何以递归方式获取Sitecore Web控件中项目的子项?我宁愿不使用Sitecore查询,因​​为我的一些路径中有破折号,这真的搞砸了.Sitecore.Context.Item.getChildren()和Sitecore.Context.Item.Children属性都只返回顶级子级.

Kyl*_*yle 9

从Sitecore看,这样做的方法是Item.Axes.GetDescendants()

  • 要小心,因为你永远不知道有多少孩子,这可能会成为一个昂贵的功能. (2认同)