Renaming the Title Column in a SharePoint List

Written in

by

A colleague was wondering if it is possible at all to rename the Title column in a SharePoint list and I thought it is worth blogging about. First some background info on the Title column for the people who are new to SharePoint development. The Title column is usedĀ as the primary column throughout all the lists in SharePoint. The column is of type Text and it exists in 2 more forms: LinkTitleĀ and LinkTitleNoMenu. Title itself simply renders the data stored in the Title column. LinkTitleĀ on the other hand is calculatedĀ and renders the data from Title as a hyperlink to the list item along with the drop down menu with commands for that list item. LinkTitleNoMenuĀ is similar to LinkTitleĀ but has no drop down menu. So what needs to beĀ done, is reference these columns and change their display name. So lets doĀ this in a content type associated to a list definition. Most important are the IDs of these 3 columns. I need to put a sticky on my monitor with these IDs since I keep losing them and I use them often:

  • LinkTitle: {82642ec8-ef9b-478f-acf9-31f7d45fbc31}
  • LinkTitleNoMenu: {bc91a437-52e7-49e1-8c4e-4698904b2b6d}
  • Title: {fa564e0f-0c70-4ab9-b863-0177e6ddd247}

So lets start with our Content Type. The content type needs to declare these fields again but provide a different DisplayName. In this case, I called them ā€œRenamedā€:

<!–simple text field–>
<Field ID=”{d723611e-cb25-43c4-9612-342d08379f81}”
Type=”Text”
Name=”SampleCTField”
DisplayName=”SampleCT Field”
StaticName=”SampleCTField”
Hidden=”FALSE”
Required=”FALSE”
Sealed=”FALSE” />

<ContentType ID=”0x0100bf4e4d793a2545799782a26331b7be3e”
Name=”SampleCT”
Group=”Development”
Description=”Developing Content Type”
Version=”0″>
<FieldRefs>
<FieldRef Name=”LinkTitle” ID=”{82642ec8-ef9b-478f-acf9-31f7d45fbc31}” DisplayName=”Renamed” Sealed=”TRUE”/>

Ā Ā Ā Ā Ā  <FieldRef Name=”LinkTitleNoMenu” ID=”{bc91a437-52e7-49e1-8c4e-4698904b2b6d}” DisplayName=”Renamed” Sealed=”TRUE”/>

Ā Ā Ā Ā Ā  <FieldRef Name=”Title” ID=”{fa564e0f-0c70-4ab9-b863-0177e6ddd247}” DisplayName=”Renamed” Sealed=”TRUE”/>

<FieldRef ID=”{d723611e-cb25-43c4-9612-342d08379f81}” Name=”SampleCTField” />

</FieldRefs>
</ContentType>

Now we need to associate our Content Type to a List Definition. There are a few ā€œgotchasā€ here though. So you just edited your copy of schema.xml to include the content type by entering its ID in the ContentTypes section:

xmlns:ows=”Microsoft SharePoint” Title=”SampleList” FolderCreation=”FALSE” Direction=”$Resources:Direction;” Url=”Lists/SampleList” BaseType=”0″ Name=”SampleList” Id=”ff5184e3-c0db-4b4d-9cae-41315f66c910″ Type=”100″ xmlns=”http://schemas.microsoft.com/sharepoint/”&gt;
<MetaData>
<ContentTypes>
<ContentTypeRef ID=”0x0100bf4e4d793a2545799782a26331b7be3e” />
</ContentTypes>

ā€¦

You create an instance ofĀ your definition but shockingly you discover your columns are not there and the Title column is not renamed! This is how SharePoint currently behaves. When you add a Content Type to the list definition, the columns are not added automatically; you must declare them in the list definition again. So go to the Fields section of your schema.xml and append your columns:

ā€¦<Fields>
<Field ID=”{d723611e-cb25-43c4-9612-342d08379f81}” Type=”Text” Name=”SampleCTField” DisplayName=”SampleCT Field” StaticName=”SampleCTField” Hidden=”FALSE” Required=”FALSE” Sealed=”FALSE” />
<Field Name=”LinkTitle” ID=”{82642ec8-ef9b-478f-acf9-31f7d45fbc31}” DisplayName=”Renamed” Sealed=”TRUE” Type=”Calculated”/>

<Field Name=”LinkTitleNoMenu” ID=”{bc91a437-52e7-49e1-8c4e-4698904b2b6d}” DisplayName=”Renamed” Sealed=”TRUE” Type=”Calculated”/>

<Field Name=”Title” ID=”{fa564e0f-0c70-4ab9-b863-0177e6ddd247}” DisplayName=”Renamed” Sealed=”TRUE” Type=”Text”/>
</Fields>ā€¦

Also do not forget to add your fields to your views. This is another pain in list definition development where the associated content type columns are not visible in the default view. So go to each View element and enter under its ViewFields element your column references. You should find that the Title column is always declared there so go ahead and add any other columns you like. The internal name alone will do just fine:

<ViewFields>
<FieldRef Name=”LinkTitleNoMenu”>
<!–FieldRef>
<FieldRef Name=”SampleCTField”>
</FieldRef>
</ViewFields>

I also uploaded the source code for this example. The project was developedĀ with Visual Studio 2008 SP1Ā and the x64Ā version of VSeWSS 1.3 CTP.
http://cid-28159fd1410e3d28.skydrive.live.com/embedrowdetail.aspx/RenameSharePointTitleFieldExample

 

Update: This solution works under SharePoint 2010 & 2013 as well. The only limitation in those editions is that you cannot have more than one Content Type with a different Display Name for the Title column as it is shared with list.

Sample List screenshot, showing the title field renamed to "Renamed"

Tags

9 responses to “Renaming the Title Column in a SharePoint List”

  1. Mario Avatar
    Mario

    S’efharisto poli. This posting answered my question perfectly.

  2. Aleksandr Avatar
    Aleksandr

    It’s working, thank you!

  3. Tom Phillips Avatar

    Thank you. That’s a great post.

  4. pure cambogia ultra walmart Avatar

    Just desire to say your article is as astonishing.
    The clarity to your publish is just cool and that i could assume you’re knowledgeable on this subject.
    Fine along with your permission let me to snatch your
    RSS feed to stay updated with impending post. Thanks one million and please keep up the enjoyable
    work.

  5. garcinia ultra bully max supplement Avatar

    Wonderful web site. Lots of helpful information here. I am sending
    it to some buddies ans additionally sharing in delicious.
    And of course, thank you to your sweat!

  6. garnicia cambogia select review Avatar

    Everything is very open with a clear clarification of the challenges.

    It was really informative. Your website is useful. Thank
    you for sharing!

  7. julia quinn Avatar
    julia quinn

    Nice analysis – I am thankful for the info . Does someone know where my assistant would be able to acquire a sample a form example to fill out ?

  8. […] the next person with this question doesn’t have to continue searching like I did. Thanks to Lambros’s BlogĀ for the […]

Leave a comment