Tuesday, 13 March 2012

Reset Presentation Details

Yo long time haven't post here. There are few things i would like to share but let me start with "Reset Presentation Details" first, the others will be on another post :)

So there was a case that I need to reset the presentation details (the layout didn't follow the layout defined in standard template) for a lot of items. I debugged the Sitecore, and found out very simple code. Here it is


Field field = item.Fields[FieldIDs.LayoutField];
item.Editing.BeginEdit();
field.Reset();
item.Editing.EndEdit();

Enjoy resetting your items haha