Custom Actions Menu for a Specific Sharepoint List

I want my custom action menu to apply to a specific list; it is currently listed with the following XML and applies to all lists!

More specific; I even want this custom action to apply to a specific kind of specific list ...

<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> 

How can i do this?

+7
sharepoint sharepoint-2007
source share
2 answers

Create a content type (based on the item you want to create in the ECB menu) and add the content type to your list. Create a customAction and register it in the content type. The ECB menu will be displayed only in the elements of this content type in the lists in which you added the content type.

Here is the content type base in the document content structure:

  <?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>... 

Create a custom action for the content type (content type identifier):

  <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> 
+9
source share

It’s not easy to target customActions to specific lists. One very tiny description I found here: http://www.dotnetprodigy.com/2009/01/how-to-create-custom-action-specific-to.html (and also here: http: // mnish. blogspot.com/2009/04/create-custom-action-specific-to-list.html )

+1
source share

All Articles