仅绑定到我的自定义内容类型的共享点列表定义

发布于 2024-07-15 19:31:25 字数 277 浏览 5 评论 0 原文

我正在开发一个 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??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

执手闯天涯 2024-07-22 19:31:26

在 schema.xml 中,您需要

中 进行 2 处更改: 元素添加以下属性:

EnableContentTypes="TRUE"

元素应包含 指定您的自定义内容类型的元素。

例如:

<?xml version="1.0"?>
<List 
  xmlns:ows="Microsoft SharePoint" 
  Title="List_Title" 
  FolderCreation="FALSE" 
  Direction="$Resources:Direction;" 
  Url="Lists/List_Title" 
  BaseType="0" 
  Name="List_Title" 
  Id="51D716AC-DF9D-4ebb-9F8E-9134EEBB7C39" 
  Type="100" 
  xmlns="http://schemas.microsoft.com/sharepoint/"
  EnableContentTypes="TRUE"
>
  <MetaData>
    <ContentTypes>
      <ContentTypeRef ID="0x01..." />
    </ContentTypes>

In the schema.xml you need to make 2 changes

in the <List> element add the following attribute:

EnableContentTypes="TRUE"

the <ContentTypes> element should contain a <ContentType> element that specifes your custom Content type.

for example:

<?xml version="1.0"?>
<List 
  xmlns:ows="Microsoft SharePoint" 
  Title="List_Title" 
  FolderCreation="FALSE" 
  Direction="$Resources:Direction;" 
  Url="Lists/List_Title" 
  BaseType="0" 
  Name="List_Title" 
  Id="51D716AC-DF9D-4ebb-9F8E-9134EEBB7C39" 
  Type="100" 
  xmlns="http://schemas.microsoft.com/sharepoint/"
  EnableContentTypes="TRUE"
>
  <MetaData>
    <ContentTypes>
      <ContentTypeRef ID="0x01..." />
    </ContentTypes>
属性 2024-07-22 19:31:26

这两个答案都对我有帮助,但我还发现您需要在列表定义中再次指定列(不仅在内容类型中),因为否则它们将不会显示在列表中。

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.

橘香 2024-07-22 19:31:25

您必须编辑自定义列表的 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" />)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文