The below steps can be used for any of the information synchronized from Active Directory but I found the Mobile Phone field to be the most common one.
With the mobile phone populated in Active Directory we want to make it visible from the users profile page and from the people results page.
To make it automatically visible from the users public profile then you will need to edit the ‘Person.aspx’ page on the SharePoint Servers file system. This is not a recommended practise but if you have a limited number of SharePoint Web facing Servers and the process of the change is fully documented then in a controlled environment this works fine.
The file is located normally in: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\SiteTemplates\SPSMSITEHOST
Modifying the Person.aspx page which can be completed in notepad if no other development tool is available simply requires the following line in red added:
<div style="padding-left: 20px;" class="ms-contactcardtext3" id="ProfileViewer_ValueWorkPhone">
<SPSWC:ProfilePropertyValue PropertyName="WorkPhone" dir="ltr" runat="server"/>
</div>
<div style="padding-left: 20px;" class="ms-contactcardtext3" id="ProfileViewer_ValueCellPhone">
<SPSWC:ProfilePropertyValue PropertyName="CellPhone" dir="ltr" runat="server"/>
</div>
<div style="padding-left: 20px;" class="ms-contactcardtext3" id="ProfileViewer_ValueOfficeLocation">
Once the file is saved then ensure a copy is updated on each Web facing SharePoint Server.
Modifying people search to include the mobile phone number is through a more recognized way of editing the web part. This is carried out following the below guidelines and as it is stored in the Database becomes available all over the farm.
Find the PeopleResults.aspx in the Search Center
Edit the page,
Edit the People Search Core Results webpart,
Expand Display Properties,
If enabled then uncheck ‘Use Location Visualisation’
Edit the Fetched Properties XML (SharePoint bug in that can’t expand to see all XML)
Add: <Column Name="MobilePhone" HitHighLight="true"/>
Then in ‘XSL Editor’ add the following lines in red around the existing lines in blue:
<xsl:variable name="haswph" select="string-length(workphone) > 0"/>
<xsl:variable name="hasmph" select="string-length(mobilephone) > 0"/>
<xsl:variable name="hasonum" select="string-length(officenumber) > 0"/>
Plus:
<xsl:if test="$haswph">
<li id="PhoneField">
<xsl:apply-templates select="hithighlightedproperties/workphone" />
</li>
</xsl:if>
<xsl:if test="$hasmph">
<li id="PhoneField">
<xsl:apply-templates select="hithighlightedproperties/mobilephone" />
</li>
</xsl:if>
<xsl:if test="$hasonum">
<li id="OfficeField">
<xsl:apply-templates select="hithighlightedproperties/officenumber" />
</li>
</xsl:if>



There are certainly a lot more details to take into consideration, but thanks for sharing this post. Today SharePoint Consulting were very popular and their advisors to provide their best service for your business organizations.
ReplyDeleteExcellent! Thanks Anthony.
ReplyDeleteThis was great, the only post which REALY shows how to do this task
ReplyDeleteAll other posts i read had no idea
Do you know if there is any variation to this when running FAST search? I'm having trouble getting this to work
ReplyDeleteNever mind. Working now. Helps if you map the Mobile field first!
ReplyDeleteGreat Post. Tried the same steps...but in the search result mobile no is not displaying. What else I should look into? Mapped Property or user profile property or something... Please help
ReplyDeleteBeen a while getting back to you but a common problem people find is unchecking the ‘Use Location Visualisation’. Check the steps from that part onward I would suggest.
DeleteThanks, of all the blogs on this topic, yours is the most concise, and accurate. Works 100%.
ReplyDeleteThanks, great solution
ReplyDeleteHow does this work for SharePoint 2013? I don't see the option to modify the XSL.
ReplyDelete