我已经为列表编写了一个模式,只需将一列添加到默认自定义列表中,该列表是一个名为months的数字字段。该字段显示在默认视图中,并确实在列表中创建。该列表使用可自行设置的值进行自动填充。问题在于该字段未显示在显示/编辑/新页面上。它可以通过数据表视图进行设置。我不明白为什么当我在架构中专门设置它时没有显示出来。未显示在显示/编辑/新页面中的SharePoint字段
会非常appriciate任何建议。
<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint"
Title="ReviewPeriods"
FolderCreation="FALSE"
Direction="$Resources:Direction;"
Url="Lists/ReviewPeriods"
EnableContentTypes="TRUE"
BaseType="0">
<MetaData>
<ContentTypes>
<ContentTypeRef ID="0x01">
<Folder TargetName="Item" />
</ContentTypeRef>
</ContentTypes>
<Fields>
<Field ID="{B99EB797-4057-4a75-90BF-B40D0F89A9D9}"
Type="Number"
Decimals="0"
Min="0"
Max="100"
Percentage="FALSE"
Name="Months"
Required="TRUE"
Group="SEED"
DisplayName="Months"
StaticName="Months"
ShowInDisplayForm="TRUE"
ShowInEditForm="TRUE"
ShowInNewForm="TRUE">
</Field>
</Fields>
<Views>
<View BaseViewID="0"
Type="HTML"
WebPartZoneID="Main"
DisplayName="Default View"
DefaultView="TRUE"
SetupPath="pages\viewpage.aspx"
ImageUrl="/_layouts/images/generic.png"
Url="AllItems.aspx">
...隐藏的东西...
<ViewFields>
<FieldRef Name="LinkTitle"></FieldRef>
<FieldRef Name="Months"></FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="Title">
</FieldRef>
</OrderBy>
</Query>
</View>
</Views>
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
</MetaData>
</List>
我已经走了你列出虽然我感兴趣的是第二个解决方案第一。实际上是否可以彻底禁用列表中的内容类型,还是只是隐藏起来。 – 2009-12-02 12:41:03
如果你忽略了EnableContentTypes属性和部分,那么你会得到一个列表,其中添加的字段显示在项目的添加/编辑上 –
2009-12-02 16:51:21