English 中文(简体)
未在清单中显示内容类型Inherits=“False”
原标题:Field not displaying on list with Content types Inherits="False"

I ve下定义了内容类型的相关链接,并确定了“工具”,并添加了一条线,去除箱外的所有权领域,因为我不想在下文中看到新的/编辑/显示表格(第1号)。

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

    <!-- ===== Fields ===== -->
    <!-- Link Category -->
    <Field DisplayName="Link Category"
           Name="LinkCategory"
           ID="{654EAC00-342B-4176-9D91-613AD724F684}"
           Group="Custom"
           Overwrite="True"
           Type="Lookup"
           ShowField="Title"
           List="Lists/LinkCategoryList"
           WebId="~sitecollection" />

    <!-- ===== Content Type ===== -->
    <!-- 
    Related Links
     - Parent ContentType: Item (0x01)
    -->
    <ContentType Name="Related Links"
                 ID="0x0100c11a1db14e564574bc49a2aa9bf325d3"
                 Group="Custom"
                 Description=""
                 Inherits="False"
                 Version="0">
        <FieldRefs>
            <!-- Title (OPTION 1) -->
            <RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" />
            <!-- (OPTION 2)
            <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" 
                      Hidden="TRUE" Required="FALSE" DisplayName="_hidden" />
            -->
            <!-- Link Category -->
            <FieldRef DisplayName="Link Category"
                      Name="LinkCategory"
                      ID="{654EAC00-342B-4176-9D91-613AD724F684}"
                      Required="True" />
        </FieldRefs>
    </ContentType>

</Elements>

This does remove the title field from the content type but when I try to associate the content type with a list it does not display the LinkCategory field in the view or new/edit/display forms. Why is it so?

<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint"
      Title="Related Links"
      FolderCreation="FALSE"
      Direction="$Resources:Direction;"
      Url="Lists/RelatedLinksListDefinition"
      BaseType="0"
      EnableContentTypes="True"
      xmlns="http://schemas.microsoft.com/sharepoint/">
    <MetaData>
        <ContentTypes>
            <!-- Related Links -->
            <ContentTypeRef ID="0x0100c11a1db14e564574bc49a2aa9bf325d3" />
        </ContentTypes>
        <Fields>
        </Fields>
        <Views>
            <View ...etc...>
                <ViewFields>
                    <FieldRef Name="LinkCategory"></FieldRef>
                </ViewFields>
                <Query>
                    <OrderBy>
                        <FieldRef Name="ID"></FieldRef>
                    </OrderBy>
                </Query>
            </View>
        </Views>
        <Forms>
            <Form Type="DisplayForm" Url="DispForm.aspx"
                  SetupPath="pagesform.aspx" WebPartZoneID="Main" />
            <Form Type="EditForm" Url="EditForm.aspx"
                  SetupPath="pagesform.aspx" WebPartZoneID="Main" />
            <Form Type="NewForm" Url="NewForm.aspx"
                  SetupPath="pagesform.aspx" WebPartZoneID="Main" />
        </Forms>
    </MetaData>
</List>

作为围绕I ve在内容类型和内容类型(执行部分第2段)方面对内容类型和使用的“True”进行的一项工作,并且掩盖了标题领域,但真的要了解这里的内容和最佳办法。 提前感谢!

PS:该员额有类似的问题:SharePoint 2010: Remove FieldRef and Inherits=“TRUE”

安保部:在我使用执行部分第1段后通过2010年特别安全局管理人员浏览时,我收到下列文件:

  • Link Category Field created correctly
  • Related Links Content Type created correctly with Link Category field
  • Related Links list created with Related Links Content Type associated
  • However Related Links list has no reference to Link Category Field.
最佳回答

奥基正在我行走花园的道路......

为什么相关链接名单上没有设立联系区,这个问题与确定Inherits=“False”有关,因为我没有在清单中加以界定,尽管我对内容作了界定。 如上所述:

When SharePoint Foundation creates a list instance, it includes only those columns that are declared in the base type schema of the list or in the list schema. If you reference a site content type in the list schema, and that content type references site columns that are not included in the base type schema of the list or in the list schema, those columns are not included. You must declare those columns in the list schema for SharePoint Foundation to include them on the list.

在此:

rel=“nofollow noretinger”>http://stefan-stanev-jointpoint-blog.blogspot.com/2010/03/contentette-vs-contenttyperef.html

One ugly thing about it is that you specify a site content type to be attached to the list based on that list definition but the framework doesn’t provision the fields in the content type if they are missing in the list – so you need to add manually all content type’s fields in the Fields element of the list schema file. This is actually what I called the fields’ redefinition issue...

复制 从内容类型定义中下文的实地要素清单:

    <Fields>
        <Field DisplayName="Link Category"
               Name="LinkCategory"
               ID="{654EAC00-342B-4176-9D91-613AD724F684}"
               Group="Custom"
               Overwrite="True"
               Type="Lookup"
               ShowField="Title"
               List="Lists/LinkCategoryList"
               WedId="~sitecollection" />
    </Fields>

I can confirm that using Inherits="False" & <RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" /> does remove the title field.

在这里,为那些 st倒这一职务的人提供了另一个关于“False”的良好联系。

https://commpoint.stack Exchange.com/questions/2995/mysteries-of-the-contenttype-inherits-attribute

问题回答

暂无回答




相关问题
Finding a class within list

I have a class (Node) which has a property of SubNodes which is a List of the Node class I have a list of Nodes (of which each Node may or may not have a list of SubNodes within itself) I need to be ...

How to flatten a List of different types in Scala?

I have 4 elements:List[List[Object]] (Objects are different in each element) that I want to zip so that I can have a List[List[obj1],List[obj2],List[obj3],List[obj4]] I tried to zip them and I ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

Is List<> better than DataSet for UI Layer in ASP.Net?

I want to get data from my data access layer into my business layer, then prepare it for use in my UI. So i wonder: is it better to read my data by DataReader and use it to fill a List<BLClasses&...

What is the benefit to using List<T> over IEnumerable<T>?

or the other way around? I use generic lists all the time. But I hear occasionally about IEnumerables, too, and I honestly have no clue (today) what they are for and why I should use them. So, at ...

灵活性:在滚动之前显示错误的清单

我有一份清单,在你滚动之前没有显示任何物品,然后这些物品就显示。 是否有任何人知道如何解决这一问题? 我尝试了叫人名单。

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签