Friday, June 29, 2012

SharePoint 2010: Remove Title Field by writing declarative XML

I needed to hide the Title field in a custom content type declared by XML.

To accomplish this task you must:

  • Set Inherits to False
  • Use the RemoveFieldRef tag to remove the title

for example:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Item (0x01) -->
<ContentType ID="0x01006ffb64509c2341d2bff13b98859f792b"
Name="MyCT"
Description="My content type"
Inherits="FALSE"
Version="0">
<FieldRefs>
<RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" />
<FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="MyCustomOtherField" ... />
</FieldRefs>
</ContentType>
</Elements>



enjoy!

No comments:

Post a Comment