문제

I'm following this article (as well as different MSDN pages) and trying to add some custom template forms to my content type.

I think I'm doing all by the book, but for some reason wont deploy my version of the content type.

Instead of my XmlDocument I get the default one which is:

 <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
      <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <Display>ListForm</Display>
        <Edit>ListForm</Edit>
        <New>ListForm</New>
      </FormTemplates>
    </XmlDocument>

The Display, Edit and New entries are not my own. ListForm is the default.

My .ascx just contains some div with text in it. Just a test. It's in the right place in the CONTROLTEMPLATES folder.

What am I missing? How can I deploy with my custom templates?

도움이 되었습니까?

해결책

  1. That happened with me whenever there is an issue with your templates. I forgot what was my exact reason but there has to be some issue with your templates.

  2. Also, in order to override the templates, I realized, there is an Inherits attribute set to 'TRUE' in your definition for content type. Set that to 'FALSE' and it will pick your custom templates.

다른 팁

I think that you use incorrect rendering template ID. You should specify this id in your template. look at the excample:

<SharePoint:RenderingTemplate ID="CustomContentTypeCreateForm" runat="server">

Then you should use this id in your schema.

<FormTemplates  xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
     <New>CustomContentTypeCreateForm</New>
   </FormTemplates>

In you case, I think, SharePoint looks for ListForm id and takes default template instead of your template.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top