Customization of SharePoint list menu item – Part 1 add Custom Action Item
2010-07-06 23:37
766 查看
Customization of SharePoint list menu item – Part 1 add Custom Action Item
Posted by chrissyz on June 6, 2009It 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 would 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 includes 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/sharepoint/“>
<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/sharepoint/“>
<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}&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 Registration 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 “.doc” or “.xls” etc in the RegistrationID
If the RegistrationType is list or ProgID, John Holiday has a blog summarized all the RegistrationID, look it up!
相关文章推荐
- add a custom action to a SharePoint list actions menu for a specific list or content type
- Adding Custom Actions to the List Item Menu in SharePoint 2010 Using SharePoint Designer 2010[Sharepoint中添加自定义菜单]
- Add Ribbon button and menu item in Sharepoint 2010
- SharePoint ECB Customization-Add menu to 'sendTo'
- Sharepoint Query List Item Using CAML(folder)
- Sharepoint Query List Item Using CAML(folder)
- Update list item using Linq to SharePoint
- What every SharePoint administrator needs to know about Alternate Access Mappings (Part 1 of 3)
- How to delete a large number of data in SharePoint for List when refreshing data?
- WSSv3 Technical Articles_Windows SharePoint Services 3.0编码开发工具和技巧(Part 2 of 2)
- Hide some fields for SharePoint list item when creating, updating, viewing
- Sharepoint2010-CustomAction之CopyListItem
- How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically
- Programmatically Disable Event Firing on List Item Update in SharePoint 2010
- 在VS2012里创建SharePoint Ribbon Custom Action
- Change language of UI using custom control in SharePoint 2010
- 使用SharePoint Web Serivce(2)--Update Delete a item in a list
- Custom List for Sharepoint Solution Generator
- reason: '-[SSShareActionSheetCustomItem integerValue]: unrecognized selector sent to instance 0x7fc6