Programmatically reset a a Sitecore Item’s presentation details

Just a quick post – should you need to reset an item back to using the controls defined on its template’s standard values, you can easily achieve this through code:

using (new Sitecore.SecurityModel.SecurityDisabler())
{
using (new Sitecore.Data.Items.EditContext(item))
{
item.Fields["__renderings"].Reset();
}
}

I’ve tried it, and it worked.

Programmatically reset a a Sitecore Item’s presentation details

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.