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:
- <ContentType ID="0x01080100AAAABBBBCCCCDDDDEEEEFFFF00001111"
- Name="ZhukPointContentType"
- Group="ZhukPoint"
- Description=""
- Version="0">
- <FieldRefs>
- </FieldRefs>
- <XmlDocuments>
- <XmlDocument
- NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
- <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
- <New>_layouts/ZhukPoint.ContentTypes.Demo/NewForm.aspx</New>
- <Edit>_layouts/ZhukPoint.ContentTypes.Demo/EditForm.aspx</Edit>
- <Display>_layouts/ZhukPoint.ContentTypes.Demo/DisplayForm.aspx</Display>
- </FormUrls>
- </XmlDocument>
- </XmlDocuments>
- </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>
.