Customization of Sharepoint list menu item-Part 1 add custom action item
Posted by chrissyz on June 6, 2009
It has been a while since last time I blogged. and I do feel bad about being ignorant of my blog for such a long time. so this time I am gonna show some code to feed those hungry souls. today I wowould like to talk about adding a list menu item through feature. this example is to add a menu item in a calendar list.
We all know a feature between des two files, feature. xml and elements. xml
In our feature. XML, nothing special, it will look like any other normal
Feature. xml
<? XML version = "1.0" encoding = "UTF-8"?>
<Feature id = "guid"
Title = "calender list menu"
Description = "creates custom action in calender list item menu"
Version = "12.0.0.0 ″
Hidden = "true"
Scope = "site"
Xmlns = "http://schemas.microsoft.com/?point/">
<Elementmanifests>
<Elementmanifest location = "elements. xml"/>
</Elementmanifests>
</Feature>
Then comes the elements. xml
<? XML version = "1.0" encoding = "UTF-8"?>
<Elements xmlns = "http://schemas.microsoft.com/?point/">
<Customaction
Id = "F699684E-3127-428e-BF2B-EA71CA6E36C8"
Registrationtype = "list"
Registrationid = "106"
Location = "editcontrolblock"
Sequence = "1000"
Title = "calendar Custom Action">
<Urlaction
Url = "~ Site/yourpagelibrary/yourcustompage. aspx? Id = {Itemid} & amp; List = {listid} "/>
</Customaction>
</Elements>
Registrationtype can be "contenttype", "filetype" (for example if you only want your feature appear to. xsn file), list and prog ID.
The registrationid element is used to specifiy the ID of registrationtype. If registrationtype is "contenttype", to get regiid ID, open the document library settings, In the contenttype section click on the content type you
Choose, then grab the hex string in the URL after "ctype =" parameter.
If you use filetype as registrationtype, then just add the authentication .doc "or 2.16.xls" etc in the registrationid
If the registrationtype is list or progid, John holiday has a blog summarized all the registrationid, look it up!