Sometimes we need to change the display name of fields which are already present in Sharepoint. Suppose we inherit our content type from Announcement content type and now need to change the name of the "Title" field to "Announcement Title".
Here is how it can be done in SharePoint 2010 using xml declarations.
Create a custom content type based on Announcement content type in Visual Studio 2010 and select deploy as a farm solution. An important thing to remember is SharePoint 2010 introduces a new property "Inherits" in a content type and by default its value is true. We need to change its value to false in order to rename the title field as shown in the elements.xml file:
As can be seen I have added a new text field named location in my content type. In the <FieldRef> section. I have added the GUID of the Title field and mentioned the DisplayName property as "Announcment Title".
The GUID of the Title field can be obtained from the fieldswss.xml file located at 14\Template\Feature\fields folder. The default sharepoint fields are present in this file.
Here is how it can be done in SharePoint 2010 using xml declarations.
Create a custom content type based on Announcement content type in Visual Studio 2010 and select deploy as a farm solution. An important thing to remember is SharePoint 2010 introduces a new property "Inherits" in a content type and by default its value is true. We need to change its value to false in order to rename the title field as shown in the elements.xml file:
As can be seen I have added a new text field named location in my content type. In the <FieldRef> section. I have added the GUID of the Title field and mentioned the DisplayName property as "Announcment Title".
The GUID of the Title field can be obtained from the fieldswss.xml file located at 14\Template\Feature\fields folder. The default sharepoint fields are present in this file.