Geeks With Blogs
David Jacobus SharePoint Consultant

I have a client that desired to have the MOSS 2007 capability of My Links but in no way wanted My Sites in SharePoint 2010.  I took some steps that gave them the capability of My Links by creating a personalized web part that could be linked to in a modal.  It worked, However, in addition, they didn’t want users without web admin rights to see the SharePoint ribbon. The result was that admins could use the web part and the personalization data would be kept by SQL in the personalization database.  Members could not edit the web part as they didn’t have access to the Ribbon.  (Catch 22).    I took another look at the MOSS 2007 My Links and SharePoint 2010 My Links and I saw that the Personalization was to tied to the User Profile Service and was not tied to SharePoint My Sites!  Ah Ha!, we could deliver this and SharePoint would do all the work!  Here are the steps to make this happen:

1.  Go to the web part gallery:

image

2.  Click the Documents Tab, and then New Document:

image

3.  A Modal will open up, scroll to Microsoft.SharePoint.Portal.Web Controls.QuickLinksMicroView

image

4.  Scroll back up to the top of the page and click on the Populate Gallery button:

image

5.  Create a page in the pages library at the site collection level and use the Blank Web Parts page layout.  Add the QuickLinksMicroView web part to the header web part zone:

image

6:  Edit the web part properties and change display to Title Only, and The name to My Links;

image

7:  Save the page and Publish.

 

I wanted this page to appear in a modal from the master page so I create a link in the global links portion of the master page.  I used an ASP.NET Hyperlink Control as I needed to set the value of the link in the master page code behind.  I didn’t at first and used a simple anchor tag with href .  However, I couldn’t think of any way that would allow the correct link to be passed to a JavaScript from sub pages and possibly the layouts folder, it worked just fine at the site collection level but not in sub sites.  Therefore, the reason for the code behind.

 

The code behind on the master page:

 


protected void Page_Load(object sender, EventArgs e)
{

    if (!IsPostBack)
    {

        SPSite site = SPContext.Current.Site;

       
        HyperLink hl = this.FindControl("HyperLink4") as HyperLink;
        hl.NavigateUrl = String.Format("javascript:OpenDialog('{0}/pages/links.aspx')", site.Url);

    }
}

 

where open Dialog is a JavaScript function load in the master page Script tag:

 

function OpenDialog(myurl) {
    var options = SP.UI.$create_DialogOptions();
    options.url = myurl;
    // options.width = 500;       
    // options.height = 400;      
    //options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);        
    SP.UI.ModalDialog.showModalDialog(options);
}

 

The demo I  am making here does not have this master page so I will just open the MyLinks page with different users to show how it works. 

image

8:  Click on the My Links (link) this will open up the the My Site Host which is linked to the Users Profile:

image

 

image

image

9:  Now Log in as a different user:

image

The Rest is the same as above.  Personalization is taking place.

A great way to get users to their profile page and add custom links which will follow them around while in the site collection.  The master page I am demo’ing here has the I Like it and Tagging control in the upper right so it will also get users to see their Tags and Notes from their profile page.  For example:  I tag the Generic Landing Page:

 

image

 

image

 

The client Didn’t want my sites so I created another master page for the My Site Host and hid the Links for MY Site,  and My Content and made sure that the client turned off self service site collections.  In addition I had the Site Admin add a link in Central Admin to add a Portal Link back to the site collection root on all Profile pages.

Posted on Sunday, August 14, 2011 4:13 PM SharePoint | Back to top


Comments on this post: SharePoint 2010 MY Links without My Sites

# re: SharePoint 2010 MY Links without My Sites
Requesting Gravatar...
Great post...I knew this web part was hiding somewhere...thanks for helping me find it
Left by Arun Asokan on Feb 16, 2012 11:21 PM

Your comment:
 (will show your gravatar)


Copyright © David Jacobus | Powered by: GeeksWithBlogs.net