public static int GetRenderingCount(string placeholderKey)
{
var renderingReferences = Sitecore.Context.Item.Visualization.GetRenderings(Context.Device, false);
return renderingReferences.Count(r => r.Placeholder.TrimEnd('/').EndsWith(placeholderKey, StringComparison.OrdinalIgnoreCase));
}
2. To get the layout used on the item:
Sitecore.Context.Item.Visualization.GetLayout(Sitecore.Context.Device)
2. To get the layout used on the item:
Sitecore.Context.Item.Visualization.GetLayout(Sitecore.Context.Device)
No comments:
Post a Comment