I want to display the user profile picture next to the Welcome Menu in the top right and I have it working after following Erik Swenson's blog but it doesn't seem to be working on My Sites. This is the code I am using in the master page:

This code is at the top of the masterpage:

<%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

And this code is in the of the masterpage:

<SPSWC:ProfilePropertyImage PropertyName="PictureUrl" style="float: left; height: 20px;" ShowPlaceholder="true" id="PictureUrlImage" runat="server"/>

Like I mentioned, this code works fine and the image is displayed when on regular site, however, I added the same to my custom My Sites masterpage and nothing is displayed, any idea what it could be or what needs to be done differently for My Sites?

Thank you!!!

  • The contentplaceholder that you put it in may be missing or hidden...
    – Mike
    Aug 7 '12 at 20:18
  • thanks for the reply! but I don't think that's the problem :( I put the second line of code in the s4-trc-container-menu div of the masterpage which should put it as part of the Welcome Menu. The Welcome Menu is visible but the image is not...I've made sure to add a visibility:visble in the CSS tag for this and still nothing
    – Tudor
    Aug 7 '12 at 20:25
  • Are you using SPD? Is it appearing in Design View?
    – Mike
    Aug 7 '12 at 20:27
  • I'm actually using Visual Studio as I am stapling the masterpage as a feature to the My Site site collection. I just opened the masterpage in SPD and I don't see it in the Design View, nor do I see the Welcome Menu which is actually visible in IE. Any ideas?
    – Tudor
    Aug 7 '12 at 20:32

MySite has it's own navigation control, defined in 14/templates/controltemplates/MySiteTopNavigation.ascx. This is registered in the GlobalNavigation delegate control

This control has a MyGlobalNavigationFixup control that actually hides the RibbonTabRowRight and SiteActionsMenuMain controls to remove the default welcome control and search boxes from your master page, and it adds it's own s4-trc-container-menu (open the file on disk, and you will see).

This is why you don't see the changes on MySite. To make the changes appear on MySite as well, you need to make sure your code works for both the default control and for the one that MySiteTopNavigation adds.

  • Thanks! So what I did, is I created a copy of the MySiteTopNavigation.ascx file and added the code above in there, now the image shows up! Not sure if this is what you meant I should do but I tried placing my code in many spots within the masterpage and it didn't seem to work...
    – Tudor
    Aug 8 '12 at 16:06
  • That's close, though I think the preferred approach is to create a delegate control (copying the control as you did) and then install it so it overrides the existing control. Look at how delegate controls and overrides work. Aug 9 '12 at 16:38
  • Yes, you need to create a new delegate (copy mysitetopnavigation.ascx and change to behave correctly), like Matthew says, and then register it for the GlobalNavigationDelegate on the MySite to ovveride the default one. I just explained why it does not show. Modifying the out-of-the-box files will void Microsoft Support, so please don't do that :) Aug 14 '12 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.