Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
特定Sharepoint列表的自定义操作菜单_Sharepoint_Sharepoint 2007 - Fatal编程技术网

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

特定Sharepoint列表的自定义操作菜单,sharepoint,sharepoint-2007,Sharepoint,Sharepoint 2007,我希望我的自定义操作菜单应用于特定列表;当前,它是用以下XML指定的,并应用于所有列表 更具体地说,;我甚至希望这个自定义操作应用于特定列表的特定视图 <CustomAction Id="MyCustomActionId" Title="My Custom Action" Description="My Custom Action Description" RequireSiteAdministrator="FALSE" RegistrationTy

我希望我的自定义操作菜单应用于特定列表;当前,它是用以下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>


如何做到这一点?

将自定义操作定位到特定列表并不容易。我发现的一个非常小的描述是:(另一个在这里:)

根据要创建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):



我已经安装了stsadm扩展来修复查找字段。可以再添加一个扩展名。我可以通过Sharepoint对象模型访问正在配置的自定义操作吗?我还尝试在列表的schema.xml(list/Views/ViewHeader)中添加链接,并且该链接已被用户接受。在这里,我需要知道UrlAction~site moniker的等价物,我可能是错的,但对我来说,这段代码只适用于“Location=”EditControlBlock“@lividsquirrel是正确的——当Location=”Microsoft.SharePoint.StandardMenu”和GroupId=”时,通过上述方法将CustomAction锁定到特定的内容类型ID无效ActionsMenu”,但当Location=“EditControlBlock”(同样是@lividsquirrel声明的)时,它确实起作用。您必须使用Location=“EditControlBlock”使其起作用,这是正确的。我将更新我的答案。
    <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>