Answered Remove the default template from a content type

  • Wednesday, March 07, 2012 12:54 PM
     
     

    Hi All,

    I am currently building a content type, list definition and list instance in Visual Studio and have come across some unusual behaviour.

    When I there is no <DocumentTemplate> tag set for a  content type in the list schema it will use a default template.dotx file.

    If I go in via the GUI and change the document template to be blank when a user clicks "New Document" they will see a list of content types with the new icon next to them. Clicking this would open the "file upload" dialog. After uploading the file the user is taken to the edit metadata form with the correct content type selected.

    Bottom one is good (Code Snippet) top two are not good!

    This is the behavior I would like.

    However, when I set the <DocumentTemplate> tag to <DocumentTemplate TargetName="" /> it still loads with the annoying template.docx as the template file.

    When I set the <DocumentTemplate> tag to <DocumentTemplate TargetName=" " /> it loads with a bad URL (whitespace).

    All I want to do is declaritively set the DocumentTemplate to nothing so that I get the same behavior as if I have removed it in the GUI.

    Any pointers on this would be appriciated and thanks in advance for any help :)

    Kind regards,

    Richard Weston


    • Edited by Richard Weston Wednesday, March 07, 2012 12:57 PM Forgot to add image!
    •  

All Replies

  • Thursday, March 08, 2012 11:48 AM
     
     Answered

    Just an update for anyone else that may be experiencing this - I have discovered that in the List Definition elements.xml there is a DocumentTemplate="121" added by default. When I removed it, then it seems to work!

    Cheers,

    Rich