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>.


Share

Comments