Smart Publish Mode

Smart Publish Mode

Smart Publishing

  • The source is the database that contains the publishable items to be published
  • The target is the destination of the publish operation
  • The mode can be incremental, smart, or full
  • Languages is used to specify the language for the publish operation


C# Web Control Code

Sitecore.Data.Database source = Sitecore.Configuration.Factory.GetDatabase("master"); 
Sitecore.Data.Database target = Sitecore.Configuration.Factory.GetDatabase("web");
DateTime publishTime DateTime.Now; 
Sitecore.Publishing.PublishOptions pubOptions = new Sitecore.Publishing.PublishOptions(source, target, Sitecore.Publishing.PublishMode.Smart, "en", publishTime); 
Sitecore.Publishing.Publisher publisher = new Sitecore.Publishing.Publisher(pubOptions);
publisher.Publish();