我正在开发一个 Sharepoint 解决方案,它实现了一个新列表。 此列表有一个附加到自定义内容类型的事件接收器。
我正在使用 VSeWSS 1.3 来完成此任务,一切顺利(创建内容类型,创建列表并将其绑定到内容类型,事件接收器成功触发。
我唯一担心的是,在创建的列表中,它始终显示基本内容类型(带有标题字段的项目 CT)。通过 Web GUI,我可以隐藏此内容类型,但我找不到在 XML 定义中执行此操作的位置,也无法将其放在解决方案中以避免部署时执行双重任务。
有什么建议么??
I am developing a Sharepoint Solution, that implements a new list. This list has an event receiver attached to a Custom Content type.
I am using VSeWSS 1.3 for this task and it's going ok (the content type gets created, a list is created and bound to the content type, the event receiver triggers successfully.
My only concern is that in the created list, it always show the base Content Type (Item CT with Title field). Through the Web GUI I can hide this content type, but I can't find where to do that in my XML definitions, or make it on the solution to avoid double tasks when deploying.
Any suggestions??
发布评论
评论(3)
在 schema.xml 中,您需要
在
中 进行 2 处更改: 元素添加以下属性:
例如:
In the schema.xml you need to make 2 changes
in the <List> element add the following attribute:
the <ContentTypes> element should contain a <ContentType> element that specifes your custom Content type.
for example:
这两个答案都对我有帮助,但我还发现您需要在列表定义中再次指定列(不仅在内容类型中),因为否则它们将不会显示在列表中。
Both answers helped me, but I found also that you need to specify the columns again in the List Definition (not only in the Content Type), because otherwise, they won't show up in the list.
您必须编辑自定义列表的 Schema.xml。 找到
标记并删除任何您不希望显示的内容。您的列表定义将有一个 guid(例如),它将从架构 xml 指定列表(例如
< List Name="... ...Id="0a8594c8-5cf1-492e-88ce-df943830c88c">
)我不确定实现的目的是什么,通常有一个 feature.xml 来组合之前的 xml 文件放在一起(例如
)You will have to edit the Schema.xml for your custom list. Find the
<ContentTypes>
tag and remove any you do not wish to be shown.Your list definition will have a guid (eg.
<Elements Id="0a8594c8-5cf1-492e-88ce-df943830c88c"
) that will specify the list from the schema xml (e.g.<List Name="... ...Id="0a8594c8-5cf1-492e-88ce-df943830c88c">
)I am not sure what the implementation is for, usually there is a feature.xml to combine the previous xml files together (e.g.
<ElementManifests><ElementManifest Location="MyFeature\ListDefinition.xml" /><ElementFile Location="MyFeature\schema.xml" />
)