SharePoint 2010. Custom forms for ContentType

Small post about declaring custom create/edit/view forms for SharePoint ContentTypes.

Solution

To override forms in your custom ContentType, you have list them in Section XmlDocuments/XmlDocument/FormUrls. Like this:

  1. <ContentType ID="0x01080100AAAABBBBCCCCDDDDEEEEFFFF00001111"
  2.        Name="ZhukPointContentType"
  3.        Group="ZhukPoint"
  4.        Description=""
  5.        Version="0">
  6.  <FieldRefs>
  7.  </FieldRefs>
  8.  <XmlDocuments>
  9.   <XmlDocument
  10.     NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
  11.    <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
  12.     <New>_layouts/ZhukPoint.ContentTypes.Demo/NewForm.aspx</New>
  13.     <Edit>_layouts/ZhukPoint.ContentTypes.Demo/EditForm.aspx</Edit>
  14.     <Display>_layouts/ZhukPoint.ContentTypes.Demo/DisplayForm.aspx</Display>
  15.    </FormUrls>
  16.   </XmlDocument>
  17.  </XmlDocuments>
  18. </ContentType>

Note:If you override some ContentType, without changing any fields, to inherit the fields from the parent ContentType, you must insert a blank <FieldRefs></FieldRefs>.

Vitaly Zhukov

Vitaly Zhukov

SharePoint Architect, Developer, Technical Trainer, Microsoft MVP (Office Development). Above 15 years of total experience working with SharePoint, Dynamics CRM, Office 365, and Microsoft stack development.

You May Also Like

SharePoint 2007. The max/min value of filed in SharePoint list

SharePoint 2007. The max/min value of filed in SharePoint list

SharePoint list item attachments' size

SharePoint list item attachments' size

Mask "Created By" and "Modified By" user names from forms and views

Mask "Created By" and "Modified By" user names from forms and views

SharePoint 2013. Geolocation field type

SharePoint 2013. Geolocation field type

SharePoint Ribbon. Creating multi level menu

SharePoint Ribbon. Creating multi level menu