Displaying a custom user profile property value in the people search results
1.
Create a custom property say “seatext” as
follows in the user profile service application.
2.
Do a full crawl of people search content source
and make sure the following crawled property is present in the search service
application.
3.
Create a new Meta data property and map the
above crawled property to it.
4.
Now go to the people search results page if the
search centre is configured for the my site as
5.
Edit the page and find for the people search
core results web part and edit the web part.
6.
Make sure to add the meta data property above in
the fetched properties section as follows:
<Column Name="seatext"
HitHighLight="true"/>
7.
Then open the xslt editor and find for the the
template for single search result
<xsl:template
name="SingleResultInternal"> and declare a variable in that
section as follows:
<xsl:variable
name="hasext"
select="string-length(seatext) > 0"/>
8.
Then find for the following div <div id="ContactInfo">
<ul id="MiniContactCard">
And paste the following <li> at the
place required:
<xsl:if test="$hasext">
<li id="ExtField">
<b>Seat Extension:</b>
<xsl:apply-templates
select="hithighlightedproperties/seatext" />
</li>
</xsl:if>
And save the xslt editor and click ok and
checkin or publish the page. Check the result by searching for a user who is
having a value for that property in the user profile service application.
No comments:
Post a Comment