Mastering SharePoint

Have you ever changed the top-level Site Title Site Column?

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

Comments

Links (8/24/2008) « Steve Pietrek - Everything SharePoint wrote Links (8/24/2008) « Steve Pietrek - Everything SharePoint
on Sun, Aug 24 2008 6:53 PM

Pingback from  Links (8/24/2008) « Steve Pietrek - Everything SharePoint

NancyCentury wrote re: Have you ever changed the top-level Site Title Site Column?
on Fri, Aug 29 2008 7:51 AM

Um, no..I never did that. Wasn't me. Nope.

Amy Lisewski wrote re: Have you ever changed the top-level Site Title Site Column?
on Fri, Nov 14 2008 12:32 PM

Guilty! :)

I "fixed" it by changing it again... to "item title".

It was generic enough.  It worked as a bandaid until I could get it fixed right.

Copyright (c) 2008 Mixon Consulting, Inc.
Powered by Community Server (Commercial Edition), by Telligent Systems