Adding custom properties to MOSS People Search

Here's how you can add custom properties into the people search results.

Firstly, search for a user. Anyone will do.

Then click on Site Actions > Edit Page

Edit the People Search Core Results web part

Under the heading "Results Query Options", click the ... next to the Selected Columns and add the column:

    <Column Name="CustomPropertyName"/>

Now click on the XSL Editor... button

Look for the section: <div class="psrch-Description">

Enter this in that section:

    <xsl:with-param name="CustomPropName" select="CustomPropertyName" />

Now look for this: <xsl:template name="DisplayOfficeProfile">

Enter this in that section:

  <xsl:param name="CustomPropName" />

and:

  <xsl:if test='string-length($CustomPropName) &gt; 0'>  
   <xsl:value-of select="$CustomPropName" /> 
   -
  </xsl:if>

Now, when you click on OK, you'll get an error in the web part. Ignore that error and try to do another search to see the custom property appear in the results.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.