- http://www.eggheadcafe.com/software/aspnet/29397132/how-to-only-apply-a-custo.aspx (includes the default SharePoint ContentTypeIds)
- http://johnholliday.net/resources/customactions.html (contains the Custom Action identifiers – what to use for GroupId and Location settings)
- http://sharepointinsight.com/blog/Lists/Posts/Post.aspx?ID=33 (pretty good step-by-step instructions)
- http://www.thesug.org/blogs/moss-pit/Lists/Posts/Post.aspx?List=db170c8d%2Daeb1%2D448b%2Dbe4b%2Da863c08b4816&ID=11
When creating my list template, I used the Sharepoint Solution Generator (available for download here: http://www.microsoft.com/downloads/details.aspx?familyid=7BF65B28-06E2-4E87-9BAD-086E32185E68&displaylang=en)
In the ListDefinition.xml and schema.xml files I set the Type attribute to a large number as explained in the sharepointinsight.com link above. In my case, I set the value to 22222. I then deployed my custom list to my SharePoint site.
To create the custom menu items specific to my newly created feature:
1. I started by creating a new folder in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES.
2. I then copied the Feature.xml and ListTemplates\CustomList.xml from C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\CustomList into my new folder.
· In my case, I did not put the CustomList.xml file in a sub-directory but left it at the same level as the Feature.xml file.
· You should rename the CustomList.xml file to a name corresponding with the new list that was created (ex. NewListNameListFeatures.xml)
3. I modified the Feature Title, Feature Description and ElementManifest Location attributes in my Feature.xml to be specific for my list feature
· The ElementManifest Location attribute must match the filename specified in step 2
4. In the CustomList.xml file, renamed of course, I entered the following (click the image for a larger view):
For this specific scenario to work, some items of note are:
· The RegistrationId attribute must match the “Type” value used when creating the custom list.
· The Location attribute must be “EditControlBlock” for the new menu item to appear in the per-item edit control block menu
· There is no GroupId attribute if Location is EditControlBlock
· The RegistrationType attribute must be “List”
· I didn’t see anything specific about what the Id attribute should be, I simply used a naming convention of ListName-and-Action.
· The UrlAction Url attribute can be JavaScript instead of an actual url (e.g. Url="javascript:window.open('http://www.google.com');".
5. I then installed and activated my custom action using stsadm:
· stsadm -o installfeature -name <folder where custom action resides>
· stsadm -o activatefeature -name <folder where custom action resides> -url <my SP site url>
· iisreset
Voila! My list now has a new item in the edit control block menu.
1 comment:
sharepoint digital signature
Thanks for listing all these useful resources from where I can gather helpful information about SharePoint. This article gave me a clear idea about how to create the custom menu items. Thanks again for helping me out.
Post a Comment