0
votes

I have a feature which is provisioning 1 document library and 2 custom lists. A folder is included for each list containing the schema.xml for that list. Each folder also contains the associated forms (AllItems, DispForm, EditForm, NewForm, etc.). Everything deploys/works correctly but it seems a little redundant having the same forms copied into each list's folder. There is nothing special about these lists - the are basically a default doc library/generic list with additional fields provided through new content types (derived from Item/Document).

As far as I can tell these forms are pretty generic. Are there pre-installed forms that I can reference from my list so I don't have to deploy all of these extra files? Is there any reason I would not want to do this?

Update - moving xml in comment to original question for readability:

<Forms> 
    <Form Type="DisplayForm" Url="Forms/DispForm.aspx" WebPartZoneID="Main"/> 
    <Form Type="EditForm" Url="Forms/EditForm.aspx" WebPartZoneID="Main"/> 
    <Form Type="NewForm" Url="Forms/Upload.aspx" WebPartZoneID="Main"/> 
    <Form Type="NewFormDialog" Path="EditDlg.htm">
    ....
1

1 Answers

1
votes

There are virtual defaults that are used if you don't specify a concrete page.

All lists use these template defaults unless you use a tool like SharePoint designer to customize the page. Then the template is used to create the concrete page and you can customize the look for a particular list without affecting others.

For my custom definitions, I use

<List>
   ...
   <MetaData>
      ...
      <Forms>
         <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
         <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
         <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      </Forms>
   </MetaData>
</List>

If you have no reason to customize the out of the box version of these forms, you can use the virtual form and not deploy copies.