fix
Here is the scenario: I have a site provisioning script that creates my publishing site structure; I use a feature that provisions Default page content based on a generic layout and definition. Since my generic feature doesn`t assign title of the page – my pages are title-less and that doesn`t look good when the site is provisioned.
What I need in this case is a utility feature that will set my Default.aspx to have the title property equal to the SPWeb title. However, I don`t want to perform such a modification and leave all sorts of things in history like Modified name changed and time as well as create several versions for check in and check outs required to make a property change.
What I need is a discrete feature that will make the change but does`nt polume my metadata. I will use SPListItem.SystemUpdate();
Here is a piece of my code where I set the page title and won`t need to do a checkout and check in and modify metadata:
// web here is received from the feature properties
PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(web);SPFile defaultPage = pubWeb.DefaultPage;//defaultPage.CheckOut();//defaultPage.Update();defaultPage.Item["Title"] = web.Title;defaultPage.Item.SystemUpdate();PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(web);
SPFile defaultPage = pubWeb.DefaultPage;
defaultPage.Item["Title"] = web.Title;
defaultPage.Item.SystemUpdate();
Simple, but useful, hopefully you find it like that as well!