sharepoint - 特定 Sharepoint 列表的自定义操作菜单

标签 sharepoint sharepoint-2007

我希望我的自定义操作菜单应用于特定列表;目前它使用以下 XML 指定,它被应用于所有列表!

更具体地说;我什至希望将此自定义操作应用于特定列表的特定 View ...

<CustomAction
    Id="MyCustomActionId"
    Title="My Custom Action"
    Description="My Custom Action Description"
    RequireSiteAdministrator="FALSE"
    RegistrationType="List"
    GroupId="ActionsMenu"
    Sequence="1000"
    Location="Microsoft.SharePoint.StandardMenu" >
    <UrlAction Url="{SiteUrl}/_layouts/MySharepointArtifacts/MyCustomAction.aspx?ListId={ListId}"/>
  </CustomAction>

我怎样才能做到这一点?

最佳答案

创建一个内容类型(基于您要在其上创建 ECB 菜单的项目)并将该内容类型添加到您的列表中。创建一个 customAction 并将其注册到内容类型。 ECB 菜单只会在您添加内容类型的列表中显示给定内容类型的项目。

这是基于内置文档内容类型的内容类型:

    <?xml version="1.0" encoding="utf-8"?>
<Elements Id="f55bc095-86f5-4c0a-961e-0e8f8e6c50ed" xmlns="http://schemas.microsoft.com/sharepoint/">
  <ContentType ID="0x0101002936a05e70da4cf2a6846c669da7fdb6"
               Name="CTName"
               Group="CT group Name"
               Description="CT description"
               Version="0">
    <FieldRefs>...

为内容类型创建自定义操作(引用内容类型 ID):
    <CustomAction
        Id="MyCustomActionId"
        Title="My Custom Action"
        Description="My Custom Action Description"
        RequireSiteAdministrator="FALSE"
        RegistrationType="ContentType"
RegistrationId="0x0101002936a05e70da4cf2a6846c669da7fdb6"
        GroupId="ActionsMenu"
        Sequence="1000"
        Location="EditControlBlock" >
        <UrlAction Url="{SiteUrl}/_layouts/MySharepointArtifacts/MyCustomAction.aspx?ListId={ListId}"/>
      </CustomAction>

关于sharepoint - 特定 Sharepoint 列表的自定义操作菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1999642/

相关文章:

c# - System.PlatformNotSupportedException AesCryptoServiceProvider

asp.net - KnockoutJS 代码块中的动态 ID

sharepoint - WebPart 中的配置文件用户数据库错误

未调用 SharePoint 计时器作业

c# - SPItemEventReceiver 类中的确认框

sharepoint - 共享点列表中带有C#语法突出显示的自定义文本字段

javascript - TypeError : this. $E_0.getElementsByTagName 不是函数

jQuery <nobr> 选择器

SharePoint - 如何在列表定义中使用 <RowLimit>

c# - 将应用程序转换为支持时需要考虑哪些因素?