Reputation: 530
This is one way of determining if the Presentation Settings of an Item have been overriden:
var contextItemPresentationSettings = Sitecore.Context.Item["__Renderings"];
var standardValuesPresentationSettings = Sitecore.Context.Item.Template.StandardValues["__Renderings"];
var presentationSettingsMatch = contextItemPresentationSettings == standardValuesPresentationSettings;
Is there a better way of determining if the Presentation Settings for an Item have been overriden?
Upvotes: 2
Views: 591
Reputation: 8877
Use this:
Sitecore.Context.Item.Fields[Sitecore.FieldIDs.LayoutField].ContainsStandardValue
FYI, Sitecore.FieldIDs.LayoutField
is a constant that hold the value of the __Renderings
field ID, it's better to use those when retrieving Sitecore system fields.
Upvotes: 4