获取sitecore中item使用的子布局列表

use*_*013 0 sitecore sitecore7 sitecore-mvc sitecore7.1

我使用的是Sitecore 7.1MVC.

我需要获取用于特定Sitecore项目的子布局或渲染的项目ID.有没有办法我使用.net获取sitecore中的项目所使用的子布局/渲染列表.有些人可能会发布必要的代码.

谢谢

Opt*_*ery 5

在Sitecore MVC之前获取渲染数组的传统方法是:

Sitecore.Context.Item.Visualization.GetRenderings(Sitecore.Context.Device, false)

我相信这将返回WebForms和MVC上下文中的渲染列表.

特定于MVC,您还可以使用当前RenderingContextPageContext通过以下方式获取渲染列表:

RenderingContext.Current.PageContext.PageDefinition.Renderings

要么

PageContext.Current.PageDefinition.Renderings