Background:
I have a site that I deploy my content type too and this site has many sub-sites. The content type will be used by each sub-site.
I have a module that I want to push custom New/Edit/Display forms (Web part pages) when my feature is deployed and activated.
I want to set these forms to the content type directly (FormUrls), but I do not know how or where I should deploy my forms so that I can reference them correctly.
I know how to do this with _layouts and I also know how to use the list definition schema (setup path), but I cannot use either of these due to version requirements (We try to avoid _layouts when possible). We are required to maintain the list and form history at the time it was created. When a new version of the list/form is released, the new content type will inherit the previous and the new form will be set to the new content type.
We also cannot use Infopath (Licensing issues).
I have tried deploying the forms using a module to the Url of the content type (_cts/Content Type Name), but I cannot seem to get the content type path correct. Here is an simple example (I cannot give the actual code or I would, sorry).
Module
<Module Name="Module1" Url="_cts/Content Type" RootWebOnly="FALSE">
<File Path="Module1\MyNewForm.aspx" Url="Module1/MyNewForm.aspx" />
</Module>
Content Type
<FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
<New>Module1/MyNewForm.aspx</New>
</FormUrls>
The above example does not work and I’ve tried removing the Module -> Url attribute so it is deployed at the root and that also did not help. Any help on this would be greatly appreciated.
You can use any sharepoint library for store forms.
First, you need to deploy page to library/folder by ‘Module’, elements.xml:
Then it can be referenced as form for content type, elements.xml: