Sharepoint 为内容类型功能中的自定义字段类型设置自定义属性
我创建了一个自定义字段类型(从SPFieldText派生),并添加了一个自定义属性“MyProperty”。现在我要找的是,我需要在我的内容类型功能中使用这个字段类型 如何在内容类型定义文件中指定自定义属性,就像我们处理OOB字段类型一样 我看到了一个解决方法,但它只解决了XSD验证的问题。站点列已正确安装,但在安装该功能后,未为该列设置我在该功能中指定的值 提前感谢Sharepoint 为内容类型功能中的自定义字段类型设置自定义属性,sharepoint,Sharepoint,我创建了一个自定义字段类型(从SPFieldText派生),并添加了一个自定义属性“MyProperty”。现在我要找的是,我需要在我的内容类型功能中使用这个字段类型 如何在内容类型定义文件中指定自定义属性,就像我们处理OOB字段类型一样 我看到了一个解决方法,但它只解决了XSD验证的问题。站点列已正确安装,但在安装该功能后,未为该列设置我在该功能中指定的值 提前感谢 Arun这里是msdn论坛上的一条线索,可以回答您的问题。- 像这样的 <Field ID="{aec8cea1-d0df
Arun这里是msdn论坛上的一条线索,可以回答您的问题。- 像这样的
<Field ID="{aec8cea1-d0df-49fc-baef-d356e58423f4}" Name="ClientWorkspace" DisplayName="$Resources:Nervogrid.Lauxtermann.Root,FieldWorkspaceDisplayName;" Type="ExtendedWorkspace" Group="$Resources:Nervogrid.Lauxtermann.Root,GroupLauxtermannFields;" AllowDuplicateValues="FALSE">
<Customization>
<ArrayOfProperty>
<Property>
<Name>SiteTemplates</Name>
<Value xmlns:q1="http://www.w3.org/2001/XMLSchema" p4:type="q1:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">;#12203;#</Value>
</Property>
<Property>
<Name>HideOnDisplayForm</Name>
<Value xmlns:q2="http://www.w3.org/2001/XMLSchema" p4:type="q2:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">$Resources:core,fld_no;</Value>
</Property>
<Property>
<Name>HideOnEditForm</Name>
<Value xmlns:q3="http://www.w3.org/2001/XMLSchema" p4:type="q3:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">$Resources:core,fld_yes;</Value>
</Property>
</ArrayOfProperty>
</Customization>
</Field>
站点模板
;#12203;#
隐藏显示格式
$资源:核心,fld_编号;
隐式
$Resources:core,fld_yes;
这对我很有效
<Field ID="{EB4A62A3-5722-4D12-9AB8-BB36461D8E5D}" Type="MyCustomFieldType" Name="Website" DisplayName="Website" StaticName="Website" Required="true">
<Customization>
<ArrayOfProperty>
<Property>
<Name>MyFirstProperty</Name>
<Value>www.stackoverflow.com</Value>
</Property>
<Property>
<Name>MySecondProperty</Name>
<Value>stackoverflow</Value>
</Property>
</ArrayOfProperty>
</Customization>
</Field>
string myFieldValue = ((XmlNode[])this.GetCustomProperty("MyFirstProperty"))[0].Value;