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

Khu*_*ziz 7 sharepoint sharepoint-2007

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

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

<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>
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?

Tom*_*mso 9

Creeate内容类型(基于您要在其上创建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>...
Run Code Online (Sandbox Code Playgroud)

为内容类型创建自定义操作(引用内容类型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>
Run Code Online (Sandbox Code Playgroud)

  • 我可能是错的,但对我来说,这段代码只适用于"Location ="EditControlBlock". (2认同)