我正在這與伯特,可以在這個問題上分享更多的光,對我們在做什麼錯誤的指導將是偉大的!
1)我們創建了一個內容類型。
如
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field ID="{060e50ac-e9c1-4d3c-b1f9-de0bcac300f6}" Name="Price" DisplayName="Price" Type="Text" Required="False" Group="" ColName="Price" StaticName="Price" />
<!-- Parent ContentType: Item (0x01) -->
<!-- set Inherits="FALSE" so the new template is picked up-->
<ContentType ID="0x01000a35b7a7e98c46248e063d79ddd67f6c"
Name="MarketPlaceContentType"
Group=""
Description="Market place item, holds Title, Description, Category etc"
Inherits="FALSE"
Version="0">
<FieldRefs>
<FieldRef ID="{060E50AC-E9C1-4D3C-B1F9-DE0BCAC300F6}" Name="Price" DisplayName="Price" Required="TRUE" />
</FieldRefs>
</ContentType>
</Elements>
2)我們已經使用此內容類型
<
?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="Lists - MarketPlace" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Lists-MarketPlace"
BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/" NavigateForFormsPages="False" DisableAttachments="true" BrowserFileHandling="permissive" EnableContentTypes="TRUE">
<MetaData>
<ContentTypes>
<ContentType ID="0x01000a35b7a7e98c46248e063d79ddd67f6c" Name="MarketPlaceContentType"
Group="" Description="Market place item, holds Title, Description, Category etc" >
<FieldRefs>
<FieldRef ID="{060E50AC-E9C1-4D3C-B1F9-DE0BCAC300F6}" Name="Price" DisplayName="Price" Required="true" />
</FieldRefs>
</ContentType>
</ContentTypes>
<Fields>
<Field ID="{060e50ac-e9c1-4d3c-b1f9-de0bcac300f6}" Name="Price" DisplayName="Price" Type="Text" Required="True" Group="" />
</Fields>
<Views>
<View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
<Toolbar Type="Standard" />
<XslLink>main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="LinkTitleNoMenu">
</FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="Modified" Ascending="FALSE">
</FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
</ParameterBindings>
</View>
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE"
MobileDefaultView="TRUE"
SetupPath="pages\template\marketpgviewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx" >
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">10</RowLimit>
<ViewFields>
<FieldRef Name="MarketplaceCategories" DisplayName="Category"></FieldRef>
<FieldRef Name="LinkTitle" DisplayName="Title"></FieldRef>
<FieldRef Name="Author" DisplayName="Name" />
<FieldRef Name="Created" Format="DateOnly" DisplayName="Date"/>
<FieldRef Name="Locations" DisplayName="Location"></FieldRef>
<FieldRef Name="MarketplaceItemExpiryDate" DisplayName="Expiry Date" Format="DateOnly"></FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="ID" Ascending="False" />
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
</ParameterBindings>
</View>
<View BaseViewID="2" Type="HTML" WebPartZoneID="Main" DisplayName="Items By Category" DefaultView="false" MobileView="TRUE"
MobileDefaultView="TRUE"
SetupPath="pages\template\marketpgviewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="ItemsByCategory.aspx" >
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">10</RowLimit>
<ViewFields>
<FieldRef Name="LinkTitle" DisplayName="Title"></FieldRef>
<FieldRef Name="Price"/>
</ViewFields>
<Query>
<Where>
<Eq>
<FieldRef Name="MarketplaceCategories" />
<Value Type="Text">{MarketplaceCategories}</Value>
</Eq>
</Where>
<OrderBy>
<FieldRef Name="Created" Ascending="False" />
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
<ParameterBinding Name="MarketplaceCategories" Location="Control(tcCategories, SelectedItem)"/>
</ParameterBindings>
</View>
</Views>
<Forms>
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main"/>
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="DisplayForm" Url="CustomDisplayForm.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\MarketPlace\displayitem.aspx" UseLegacyForm="true" WebPartZoneID="Main" Template="MarketPlaceDisplayForm"/>
</Forms>
</MetaData>
</List>
3)我們的內容類型都有,我們想修改各個領域創建的列表定義他們的屬性,但我們無法輕鬆更新它們。
任何關於我們做錯的指針都會很棒!
的是價格標記爲網站內容類型需要,當你在你的列表設置,單擊內容類型(開啓,如果你不允許管理內容類型見內容類型)? –
謝謝,但我如何通過部署來管理網站內容類型? – Burt
我問這個問題的原因是因爲列表的內容類型將覆蓋網站內容類型的設置。如果你想通過部署來管理這個,你如何將內容類型與你的列表關聯起來?你在使用列表定義嗎?如果是這樣,請確保Price字段在schema.xml中標記爲必需。 –