Changing the Organization Hierarchy (ProfileManages) web control Title property on My Sites Person.aspx

We had a requirement to change the title of a control displayed on the My Sites person.aspx page from Organization Hierarchy to Organisation Hierarchy. (Yes that is right – blink and you”ll miss it!). This is the control that displays an employees manager and colleagues etc on their profile page within the My Sites host site collection: found at, for example, http://mysites/Person.aspx?accountname=DOMAIN\UserName. By default the title is rendered out in English US but our client wanted it in English UK!

As inferred, the control in question is actually defined in the person.aspx page in the “SPSMSITEHOST” site definition. It can be found on line 92 in this page:

  <SPSWC:ProfileManages FrameType="None" id="ProfileManages" runat="server" />

The SPSWC tag is defined at the top of the markup as:

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

So armed with this knowledge we can use our favourite disassembler to poke around in the Microsoft.SharePoint.Portal.WebControls namespace in the Microsoft.SharePoint.Portal assembly and work out what is going on and whether there is anything we can do. As it turns out we are in luck!

// Microsoft.SharePoint.Portal.WebControls.ProfileManages
private void RenderSectionHeader(HtmlTextWriter writer)
{
	writer.Write("<tr class=''ms-WPHeader''><td colspan=2><div class="ms-WPTitle"><nobr>");
	SPHttpUtility.HtmlEncode(this.Title, writer);
	writer.WriteLine("</nobr></div></td></tr>");
}

This leads us to a beautifully simple solution. Line 5 in the snippet above shows us that the title is set to the Title property of the control. So it follows that we can edit the person.aspx page and add the following to the control declaration.


<SPSWC:ProfileManages
      Title="Organisation Hierarchy"
      FrameType="None" id="ProfileManages" runat="server" />

This works like a charm.

This entry was posted in SharePoint, SharePoint 2007 and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>