Adding a new menu item to the SharePoint welcome/user menu is fairly straight forward.
Thanks to Sohels blog for pointing me in the right direction.
First create a new empty SharePoint project in Visual Studio 2010, call it "MenuItemProject".
Deploy as a farm solution and click finish.
Add a feature to the project. In the solutions explorer box, right click on the feature node and add feature.
Also in the solution explorer, right click the top menuItemProject node and add > new item.
Add an empty Element called "MenuAdditionElement".
Once added, open the menuAdditionElement > Elements.xml file.
Replace the Elements.xml code with the following:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="myCustomAction"
GroupId="PersonalActions"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="1000"
Title="Google"
Description="Search away">
<UrlAction Url="http://www.google.com"/>
</CustomAction>
</Elements>
Save the Elements.xml file and then in the solutions explorer double click on the feature1.feature node.
Ensure the MenuAddition Element is included in the items in the feature.
Deploy the solution to your SharePoint server.
Once deployed, refresh your site home page and the new menu item should be visible.
No comments:
Post a Comment