Adding fields to peopleresults.aspx in display templates Sharepoint 2013 -
on people search results page (peopleresults.aspx) need add in work phone , cell phone display when person searched. altered display template , got work phone display, cell phone isn't showing up. idea why might be? can offer appreciated. here code. included relevant code pieces:
<mso:managedpropertymapping msdt:dt="string">'aboutme':'aboutme','accountname':'accountname','baseofficelocation':'baseofficelocation','department':'department','hithighlightedproperties':'hithighlightedproperties','interests':'interests','jobtitle':'jobtitle','workphone':'workphone','cellphone':'cellphone','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> <body> <div id="item_personphones"> <!--#_ if(!$isnull(ctx.currentitem) && !$isnull(ctx.clientcontrol)){ var id = ctx.clientcontrol.get_nextuniqueid(); var itemid = id + srch.u.ids.item; var hoverid = id + srch.u.ids.hover; $setresultitem(itemid, ctx.currentitem); var container_id = id + "_peoplecontainer"; var hhprops = srch.u.createxmldocument("<root>" + ctx.currentitem.hithighlightedproperties + "</root>"); var encodedpath = $urlhtmlencode(ctx.currentitem.path); var has_pn = !$isemptystring(ctx.currentitem.preferredname); var has_sip = !$isemptystring(ctx.currentitem.sipaddress); var has_email = !$isemptystring(ctx.currentitem.workemail); var has_jt = !$isemptystring(ctx.currentitem.jobtitle); var has_dp = !$isemptystring(ctx.currentitem.department); var has_wp = !$isemptystring(ctx.currentitem.workphone); var has_cell = !$isemptystring(ctx.currentitem.cellphone); var has_abme = !$isemptystring(ctx.currentitem.aboutme); var has_resp = !$isemptystring(ctx.currentitem.responsibilities); var has_pp = !$isemptystring(ctx.currentitem.pastprojects); var has_ski = !$isemptystring(ctx.currentitem.skills); var has_sch = !$isemptystring(ctx.currentitem.schools); var has_int = !$isemptystring(ctx.currentitem.interests); var has_vlm = !$isemptystring(ctx.currentitem.profileviewslastmonth); var has_vlw = !$isemptystring(ctx.currentitem.profileviewslastweek); var has_query = !$isemptystring(ctx.currentitem.profilequeriesfoundyou); var isselfsrch = (has_vlm == true || has_vlw == true || has_query == true); var delimiter = ""; var userpersonaid = $htmlencode(id) + "_peopleuserpersona"; var usip = ctx.currentitem.sipaddress; var uemail = ctx.currentitem.workemail; var uname = ctx.currentitem.preferredname; var upicurl = ctx.currentitem.pictureurl; var hoverurl = "~sitecollection/_catalogs/masterpage/display templates/search/item_person_hoverpanel.js"; _#--> <!--#_ if(has_wp == true) { _#--> <div id="workphonefield"> <!--#_ var encodedwphone = $htmlencode(ctx.currentitem.workphone); var displaywphone = srch.u.getsinglehhxmlnodevalue(hhprops, "workphone"); if ($isemptystring(displaywphone)) { displaywphone = encodedwphone } _#--> <div id="workphonevalue" class="ms-srch-ellipsis" title="_#= encodedwphone =#_"> _#= displaywphone =#_ </div> </div> <!--#_ } _#--> <!--#_ if(has_cell == true) { _#--> <div id="cellphonefield"> <!--#_ var encodedcellphone = $htmlencode(ctx.currentitem.cellphone); var displaycellphone = srch.u.getsinglehhxmlnodevalue(hhprops, "cellphone"); if ($isemptystring(displaycellphone)) { displaycellphone = encodedcellphone } _#--> <div id="cellphonevalue" class="ms-srch-ellipsis" title="_#= encodedcellphone =#_"> _#= displaycellphone =#_ </div> </div> <!--#_ } _#-->
Comments
Post a Comment