I am trying to use some custom list form templates (only for Display Forms), using the technique described in this MSDN article.
My basic technique is as follows:
- Create a blank .aspx page (no code-behind)
- Copy the page directives from
- Copy the template I want to customize from
- Add my customizations, and rename the
idof the template to my custom name
- Reference my custom template name in the
Templateattribute of the Display Form form element in my list definition Schema.xml, like:
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" Template="MyCustomForm" WebPartZoneID="Main" />
- Deploy my list definition and deploy my custom form template .aspx
file to the root of the
This works as expected if I copy and try to use a custom
ListForm template for a regular list.
However, it seems that Document Libraries don't use the
ListForm template, they use the
DocumentLibraryForm template, which in turn references the
I tried using the above technique to create a custom
DocumentLibraryForm, and kept the reference to the default
DocumentLibraryFormCore template, as all of my customization could be contained in the outer template. However, SharePoint never seems to load my custom template. I have double, triple, quadruple checked that there is not a typo between the
id that I am setting in the template file and what I reference in the
Template element in my list definition Schema.xml.
I have even tried cutomizing both the
DocumentLibraryForm and the
DocumentLibraryFormCore templates, and referencing my custom
Core form from my custom
DocumentLibraryForm, and still nothing.
I have also searched for "DocumentLibraryForm" within the DefaultTemplates.aspx file to see if there is another template that calls the
DocumentLibraryForm template, and is really the "outer" template I should be customizing, but there is none.
Why is SharePoint ignoring my custom form template?
Is there another template in a different file that I need to be overriding/customizing?