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

Tech Lead, Architect, Developer, Technical Trainer, Microsoft MVP. Over 20 years of experience in system integration and software development. I specialize in designing and implementing scalable, high-performance software solutions across various industries.

You May Also Like

Collect SharePoint telemetry with Azure Application Insights. Part I. Server-Side

Collect SharePoint telemetry with Azure Application Insights. Part I. Server-Side

SharePoint New Team Site. Inside Out

SharePoint New Team Site. Inside Out

SharePoint 2019 Preview

SharePoint 2019 Preview

SharePoint Ribbon. Creating multi level menu

SharePoint Ribbon. Creating multi level menu

SharePoint 2013. Geolocation field type

SharePoint 2013. Geolocation field type

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 list item attachments' size

SharePoint list item attachments' size

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

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