SharePoint 2010: Create a bookmark button that adds a page to your My Links

admin

Administrator
Staff member
I am trying to create a link/button on my masterpage which when clicked, adds the current page to the user's <strong>My Links</strong> list. This is merely a shortcut to save the user from having to navigate to their <strong>My Site</strong> and add the link manually.

<a href="http://clintoncherry.wordpress.com/2007/07/16/creating-a-bookmark-button-in-sharepoint/" rel="nofollow">[This blog post]</a> gives a solution to this problem, but I get a JavaScript error on the second line of the "Add Link" dialog (QuickLinksDialog2.aspx) because the <strong>frameElement</strong> property is null:

Code:
&lt;script language="Javascript"&gt;
    var form = document.forms[0];
    var args = window.parent.frameElement.dialogArgs;

Regardless, <strong>Portal.js</strong> appears to contain all the functions that the My Links page (_layouts/MyQuickLinks.aspx) uses to add links to this list.

Can anyone suggest how I might go about calling one/some of these functions from my masterpage so that the "Add Link" dialog is opened with the title and URL fields pre-poulated?