Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created a custom content type and I would like to have all lists that use that content type use it's edit/new forms. Below is the XML i have in my Elements.xml file:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ContentType ID="0x0100211ACDF9A8F75C4190D46F1ADCF5015604308633d0aadc3f41809a6430a81fe0151b"
               Name="TestContentType - TestContentType"
               Group="Custom Content Types"
               Description="This is a test.  This is only a test."
               Inherits="FALSE"
               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">
          <Edit>_layouts/TestContentType/TestContentEdit.aspx</Edit>
          <New>_layouts/TestContentType/TestContentNew.aspx</New>
        </FormUrls>
      </XmlDocument>
    </XmlDocuments>
  </ContentType>
</Elements>

But when I click "Add Item" in my list that is using this content type the standard form comes up. Am I going at this wrong?

share|improve this question
    
Did you test with new list after the feature was activated? I guess it may not work with list that already exist when you activated the feature. –  Ashish Patel Oct 12 '11 at 0:11
    
How are you adding the content type to the list? Also, is the content type the default on the list? –  CMN Sep 15 '12 at 20:21

1 Answer 1

Never tried it this way, however I use the following method.

  • I basically create a list definition and assign the custom form to it.
  • Then I create my lists from the definition in code.

May be of some use to you.

I create a List Definition and deploy it to the site. My List Definition schema file has the following:

...
<Forms>
      <Form Type="DisplayForm" SetupPath="features\FeatureName_Feature1\ListDefinitionName\CustomDisplayForm.aspx"
                Url="Forms/DispForm.aspx" WebPartZoneID="Main" UseLegacyForm="TRUE" />
      <Form Type="EditForm" SetupPath="features\FeatureName_Feature1\ListDefinitionName\CustomEditForm.aspx"
                Url="Forms/EditForm.aspx" WebPartZoneID="Main" UseLegacyForm="TRUE" />
      <Form Type="NewForm" Url="Forms/Upload.aspx" WebPartZoneID="Main" />
      <Form Type="NewFormDialog" Path="EditDlg.htm">
...

The set up path is where my custom forms are located and in my case, thats in the sharepoint hive in the feature directory under templates.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.