Tuesday, January 13, 2009

Changing Title Site Column name

When creating a new site content type you are required to choose a type that it will inherit from. The simplest type is a list content type who's parent is 'Item'.
The problem is that you'll end up with a default column called 'Title'. Great, what if I don't want a column called Title?

DO NOT ATTEMPT TO CHANGE THIS COLUMN!!
This column is inherited by every list item across the site. If you change the name, the entire site will change! What really gets you, is that you can't change it back!
The form checks and see's that the name 'Title' is reserved. It doesn't care that you're not using it anymore.

If you've already done this, There is a way to change it back. (http://www.eggheadcafe.com/software/aspnet/29625393/title-site-column.aspx)


Here's the basic idea:
Open the page that lets you change the name and save it to your computer(the complete page). Open the page, and remove the javascript that does the check:

if (doesFieldNameConflict(DisplayName))
{
alert(L_alert3_Text);
frm.DisplayName.focus();
return false;
}


Open the page, rename it back to "Title" and hit save. SharePoint isn't smart enough to realize that the page lives on your computer and not the server. It will let you change it back.


The right solution is to edit your site content type, and change the 'Title' field to be hidden. Then create a new column called Title, or whatever you want to name it.

The problem this creates, is that whenever you have a view of the list, the Title field is the one that is used to link to the DispForm, and also has the drop down list of options to modify that row.
The only solutions I've seen so far is to create your content types with a feature. This isn't a good solution when you're trying to prototype something though.

No comments: