Rename ‘Title’ in a SharePoint List

Sometimes you would like to rename the Title field in a SharePoint List. For example: in a list of Countries where the title should be named Country Code. In SharePoint this is easy to change:

  • access the settings for particular list;
  • in the columns section click on the Title column;
  • change the name of the column and save.

While doing this you only change the display name for the title column for this particular list. Never change the parent Title column!

It works all fine, but when you want to package you “Countries” list you face a new challenge. To package the countries list you create a new List Definition and List Instance in Visual Studio.

When the List Definition is created, have a look at the Schema.xml file. The schema file contains content types, fields, views and other information about this list. To change the display name of the Title column you need to include the Title field information in the schema file.

Add the following XML snippet between the Fields section of the Schema file.

<Field Type="Text" DisplayName="Country Code" StaticName="Title" Name="Title" ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" />

You have now changed the Display Name of the Title column. When you deploy the solution to you SharePoint environment, you will see that not every “Title” has changed to Country Code.

Not Every title has changed

This is because SharePoint is using other (hidden) fields to render its view, named: LinkTitle and LinkTitleNoMenu. Add the following XML to the Fields section of the Schema file.

<Field Type="Computed" DisplayName="Country Code" StaticName="LinkTitle" Name="LinkTitle" ID="{82642ec8-ef9b-478f-acf9-31f7d45fbc31}" />
<Field Type="Computed" DisplayName="Country Code" StaticName="LinkTitleNoMenu" Name="LinkTitleNoMenu" ID="{bc91a437-52e7-49e1-8c4e-4698904b2b6d}" />

When you reploy the solution you will see that the Display Name of every Title column has changed

Every Title has changed

1 Comment

Filed under Package, SharePoint

One Response to Rename ‘Title’ in a SharePoint List

  1. Riyaz

    Thanks for posting, it saved time… :-)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>