Custom Action Menu in sharepoint

In this article I will describe that how to add
custom link on site action menu,
List Action menu,
Site Setting page,
Document library toolbar new menu,
Document library action menu,
per item drop down.

Detail:-

Create your usual WSP solution. How to create WSP solution; for this please visit my below article:-
Create web part using WSP solution.

Solutions structure can be like below:-

Here “Home.Project.Solution.MyDocs” is custom folder name which contains feature and elements xml file.

solution_Feature

1. Feature.xml

here you can target your other “ElementManifest” but as per my example i will write only one entry for custom action menu. See below:-

1
2
3
4
5
6
7
8
9
10
11
12
<?xml version="1.0" encoding="utf-8"?>
<Feature  Id="write feature id here"
          Title="CustomActionMenu"
          Description="Provides Custom Action Menu."
          Version="12.0.0.0"
          Hidden="FALSE"
          Scope="Site"
          DefaultResourceFile="core"
          xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="Elements.xml" />       <!-- Adding link in different Action menu -->
  </ElementManifests>

2. Elements.xml

This file has detail to mention about custom action. See below:-

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?xml version="1.0"  encoding="utf-8"  ?>
<Elements  xmlns="http://schemas.microsoft.com/sharepoint/">
 
<!--  Create Command  Link  Site  Settings  Page -->
<CustomAction Id="SiteSettings" GroupId="Customization"
	Location="Microsoft.SharePoint.SiteSettings" Sequence="106"
	Title="Custom Avinash Site  Setting  Command">
<UrlAction  Url="/_layouts/AvinashFeatureRND.aspx?Command=SiteSettingCommand"/>
</CustomAction>
 
<!--  Add  Command  to  Site  Actions Dropdown  -->
<CustomAction  Id="SiteActionsToolbar" GroupId="SiteActions"
	Location="Microsoft.SharePoint.StandardMenu" Sequence="1000"
	Title="Avinash  Custom Action" Description="Custom Avinash  Site  Action"
	ImageUrl="/_layouts/images/ACL16.GIF">
<UrlAction  Url="/_layouts/AvinashFeatureRND.aspx?Command=SiteActionCommand"/>
</CustomAction>
 
<!--  Document Library  Toolbar New Menu  Dropdown  -->
<CustomAction  Id="DocLibNewToolbar" RegistrationType="List"
	RegistrationId="101" GroupId="NewMenu" Rights="ManagePermissions"
	Location="Microsoft.SharePoint.StandardMenu" Sequence="1000"
	Title="Avinash  Custom New Command"
	Description="This  command   creates  a new  sample doc"
	ImageUrl="/_layouts/images/ACL16.GIF">
<UrlAction  Url="/_layouts/AvinashFeatureRND.aspx?Command=NewDocCommand"/>
</CustomAction>
 
<!--  Document  Library  Toolbar Actions  Menu  Dropdown  -->
<CustomAction  Id="DocLibActionsToolbar" RegistrationType="List"
	RegistrationId="101" GroupId="ActionsMenu"
	Location="Microsoft.SharePoint.StandardMenu" Sequence="1000"
	Title="Avinash  Command  on  Document  Library"
	Description="This  command   performs a custom command  on   the  document library"
	ImageUrl="/_layouts/images/ACL16.GIF">
<UrlAction  Url="/_layouts/AvinashFeatureRND.aspx?Command=DocLibCommand"/>
</CustomAction>
 
<!--  Per  Item  Dropdown -->
<CustomAction Id="ECBItemToolbar" RegistrationType="List" RegistrationId="101"
	Type="ECBItem" Location="BugWorkaround:LocationShouldEqualEditControlBlock"
	Sequence="106"
	Title="Avinash  ECB Item  Command">
<UrlAction  Url="/_layouts/AvinashFeatureRND.aspx?Command=SiteSettingCommand"/>
</CustomAction>
</Elements>

Hope it helps.
Thanks!
Avinash

calendarApril 22, 2012 · cardInfoyen · commentsOne Comment
tagTags: , , , , , ,  · Posted in: MOSS, SharePoint

One Response

  1. putnam - December 10, 2012

    Thanks for sharing. Regards

Leave a Reply

Spam Protection: , required

myworldmaps infoyen