Tuesday 21 May 2013

Bypassing publishing when updating items programatically in Sitecore

if you want to just update items in the Sitecore database without having to publish the changes all you need to do is deal directly with the master database by switching Sitecore.Context to point to it by using the Sitecore built-in factory like this:

 Sitecore.Context.Database = Factory.GetDatabase("master");

now whenever you access Sitecore.Context it'll act upon the master database. you may need to do a security override depending on what you are doing. check my previous post for instructions on how to do that.

No comments:

Post a Comment