Clients that migrate from SharePoint 2007 to SharePoint 2010 may miss the old My Links functionality in their “new” environment.
In SharePoint 2007, you had the option to add sites to your My Site by clicking on a link in the User Context Menu.
In SharePoint 2010 this option is not there anymore.
The functionality is still there, but only for adding libraries to My Links. It can be found on the Library tab -> Connect to Office -> Add to SharePoint Sites.
Laura Rogers made a blog post to make the My Links available on the My Site. Her post can be found on the following URL: SharePoint 2010 - Where’d “My Links” Go?.
But what if you want to add SharePoint sites or lists to the My Links section?
This requires some manual steps to add the links to the My Links section. Most of the clients would not like this, they just want it to work as in SharePoint 2007.
In this post I will explain my approach to “re-add” the same functionality like in SharePoint 2007. The result would look like this.
Add to My Links Custom Action
The first thing I will explain is how to add the Add to My Links option to the User Context Menu.
In SharePoint 2007, three pages were being used when you clicked on the Add to My Links. The first page that opened was the /_Layouts/QuickLinksDialog.aspx page. This page contained an iframe that opened the /_Layouts/QuickLinksDialog2.aspx that immediate did a form submission to the /_Layouts/QuickLinksDialogForm.aspx page.
This is the markup for the application page.
The last step is to add the custom action which adds the Add to My Links option to the User Context Menu. The custom action markup looks like this.
As you can see in the UrlAction the Mylinks_Dialog function is called. This would give the following result in SharePoint.
Manage Links Custom Action
Now that I explained you how to add the Add to My Links, the next step is to add the Manage Links option to your site. This is an easy step, because you only need to create a custom action that links to the /_Layouts/MyQuickLinks.aspx page. This is the same page that is used as in SharePoint 2007.
If you want to install this solution you can download the my SharePoint 2010 solution file.
Deploy the solution to your SharePoint environment and activate the following site collection feature: estruyf MyLinks Feature.
If you want to make changes to the code, here is my Visual Studio project.
Solution file and code is updated to solve the Access Denied error Manjiri Patil had discovered. This was due to the fact that the application page was using an incorrect URL.