How to customise the New form for a document library in SharePoint 2010.
Note: This is not supported by Microsoft and it just a work around.
In order to create a custom New Form for a document library we will follow these simple steps:
- Create a list with exact content type (List settings > Advanced settings > Allow management of content types)
- Then click on the Customise Form (Infopath Icon)
- The form will open in Infopath
- Once the form is open select File > Publish > Export Source Files and save it in a desired location
- Edit the mainfest.xsf File in a text editor (I use Notepad++)
- Scroll down to bottom section where you should see this:
- We want to change the content type ID and the relativeUrl values here to point to the document library that we want to customise the new form for:
- In order to get the content type ID follow this post
- Change the Content type ID and Relative URL (for a document library just replace ../../ with the library name does not require a prefix library either)
- Save the mainfest.xsf
- Right click and select Design, now the form will point to the library, save and publish.
On a side note:
I have only tested this with a single content type
No comments:
Post a Comment