So have you? Not that you would ever want to admit it in public; but I hear of it all too often. Right from the browser, you can change the top-level Site Title Site Column. Doing so will change the display name of that column everywhere its used in the Site Collection. Now here is the interesting part; you can't change it back... Or, at least you may not think so.
For each Site Column, known as an SPField object at the API level, there is an internal name (SPField.InternalName) and a display name (SPField.Title) being maintained. When you change a Site Column in the browser, you are only changing the display name; i.e. SPField.Title. And, this can be changed back to its original name using the SharePoint API; and this is the only way you can change it back.
If this happens in your environment, give this a try!
C#
SPSite site = new SPSite( "[URL of top-level site]" );
SPWeb web = site.OpenWeb();
SPField titleField = web.Fields.GetFieldByInternalName( "Title" );
if( titleField != null)
{
titleField.Title = "Title";
titleField.Update();
}
web.Dispose();
site.Dispose();
If you prefer PowerShell, give this a try...
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$siteurl = "URL of top-level site"
$spsite=new-object Microsoft.SharePoint.SPSite($siteurl)
$spweb=$spsite.OpenWeb()
$spfield=$spweb.Fields.GetFieldByInternalName("Title")
$spfield.Title = "Title"
$spfield.Update()
The above code will update the Title Site Column back to its original display name of Title.
Posted
Aug 22 2008, 01:52 AM
by
Bob Mixon