Hello,
I'd like to customize the people search result page. I already added some custom profile properties without any problem. But, when adding the MobilePhone field nothing is display.
- I've created a new display template based on the "Item_Person.html" file.
- Added the "MobilePhone" field in the ManagedPropertyMapping section
<mso:ManagedPropertyMapping msdt:dt="string">'WorkPhone':'WorkPhone','MobilePhone':'MobilePhone','Room':'Room','Werkgebieden':'Werkgebieden','AboutMe':'AboutMe','AccountName':'AccountName','BaseOfficeLocation':'BaseOfficeLocation','Department':'Department','HitHighlightedProperties':'HitHighlightedProperties','Interests':'Interests','JobTitle':'JobTitle','LastModifiedTime':'LastModifiedTime','Memberships':'Memberships','PastProjects':'PastProjects','Path':'Path','PictureURL':'PictureURL','PreferredName':'PreferredName','Responsibilities':'Responsibilities','Schools':'Schools','ServiceApplicationID':'ServiceApplicationID','SipAddress':'SipAddress','Skills':'Skills','UserProfile_GUID':'UserProfile_GUID','WorkEmail':'WorkEmail','WorkId':'WorkId','YomiDisplayName':'YomiDisplayName'</mso:ManagedPropertyMapping>
3. Added a variable:
var has_MobilePhone = !$isEmptyString(ctx.CurrentItem.MobilePhone)
4. Copied the "WorkPhone" display section and changed the values to MobilePhone
<!--#_ if(has_MobilePhone == true) { _#--> <div id="MobilePhoneField"> <!--#_ var encodedMobilePhone = ctx.CurrentItem.MobilePhone; var displayMobilePhone = Srch.U.getSingleHHXMLNodeValue(hhProps, "MobilePhone"); if ($isEmptyString(displayMobilePhone)) { displayMobilePhone = encodedMobilePhone } _#--> <div id="MobilePhoneValue" class="ms-srch-ellipsis" title="_#= encodedMobilePhone =#_">MobilePhone: _#= displayMobilePhone =#_ </div> </div> <!--#_ } _#-->
Unfortunally the mobilephone does not appear in my search results.
What did I missed?