The Art of SharePoint Evolution

Stories from a SharePoint Engineer that isn’t afraid of Visual Studio.

How to Customize People Search Results

with 26 comments

Microsoft Office Sharepoint Server 2007 has a super user directory tool especially for large companies. Using the People Search/Employee Lookup you can easily search for people in your organization by name, job title, department, or any other employee attribute you could think of. But there’s a certain drawback to the results as there isn’t a friendly GUI for you to customize how the information is displayed. Instead you’ll have to edit the XSL if you’d like to change the formatting of the data. You can also include other employee attributes in the results by defining which columns in the user profile database to display such as Mobile Phone numbers.

To customize the People Search Results:

1. Search for a user so you can use that search result as a reference.

2. Go to Site Actions > Edit Page

3. Modify the People Search Core Results

4. Under the “Results Query Options” section, there is a field called “Selected Columns.” Click into this field and then click on the “…” that appears next to it.

5. In the Text Entry box that pops up you’ll be able to include new columns based on the columns you can reference from the user profile database. For example if you wanted to include a person’s mobile phone you’ll want to include <Column Name=”MobilePhone”/>

6. Now you’ll be able to edit the XSL to display the phone number using something like this:

<xsl:text>Mobile Phone: </xsl:text>
<xsl:call-template name=”DisplayOfficeProfile”>
<xsl:with-param name=”mobile” select=”mobilephone” />

That should be it. Don’t forget to check-in and publish your page!

Written by Henry

March 14, 2007 at 9:49 am

Posted in SharePoint

26 Responses

Subscribe to comments with RSS.

  1. What they want is a page where they can see a list of phone numbers based on an Active Directory group membership.

    Thanks
    JK

    John

    March 16, 2007 at 12:45 pm

  2. Is it possible to have the Employee Lookup work against part names?

    e.g seach for
    Phil

    get results for
    Phil
    Philip
    Phillip

    etc

    Simon

    March 23, 2007 at 2:15 am

  3. i’ve seen someone configure it to work like that before but not out of the box I don’t think. I remember reading about a synonyms file somewhere that you might be able to use to accomplish that.

    Henry

    March 23, 2007 at 8:31 am

  4. SharePoint Links 04.13.07

    Here’s some links to the best articles on SharePoint 2007 in the blogosphere:

    SharePoint Team blog provide us with a Visio logical architecture design samples file to give you a jump start on your own design and a Debugger “Feature” …

    Sharepoint BUZZ

    April 13, 2007 at 8:57 am

  5. Dear all,
    I want to present my contact in below order.

    Employee Name (12)
    Designation, unit
    Phone No
    Cell no
    Email address:

    I am using XSL of People core result web part, but unable to present the above look.
    Anybody knows how to do it.

    Best Regards,
    Hina

    Hina

    May 23, 2007 at 3:52 am

  6. Hi – I was wondering if you know how to modify the people search results so that the manager name shows up. I have not been able to do that. Thanks, Abby

    abby puckett

    November 3, 2007 at 2:21 pm

  7. Hey Abby, it should be the same process as above. Except you’ll have to figure out what the field name is that’s being used to store manager information.

    Henry

    November 3, 2007 at 2:59 pm

  8. Hi everybody,

    I was wondering, when you click on the name on the search result page. You will go to the my site of sharenet. Even if the my site is not active. Is there some way to link the name to the Userdisp.aspx when we don’t use the my sites????

    thanks, Jo

    Jojo

    March 4, 2008 at 3:08 am

  9. HI Everyone?

    I am also having the same requiement as Hina.
    I want to show the results as
    Employee name
    Designation
    Work ohone
    Email id

    I am able to get only that information of the employees who have their personal sites.
    Do i have to got to the shared Services and import the information of all the users from AD??
    Please help me out on this….

    Ricky Singh

    April 9, 2008 at 12:34 pm

  10. Hey Ricky, you will only be able to display information that has been imported from Active Directory into the SharePoint User Profile Database.

    Henry

    April 10, 2008 at 8:02 pm

  11. Why can you only display information from AD? SharePoint profile properties can be mapped and referenced in other areas of SharePoint… this restriction doesn’t quite make sense to me.

    Adam

    April 15, 2008 at 7:04 am

  12. Hey Adam, that’s true that you can reference other areas of SharePoint. Importing from AD is probably an easy choice since most of the account information you’re looking for is already stored there.

    Henry

    April 15, 2008 at 7:31 pm

  13. HI Everyone

    I have posted this problem before also but did not get the expected reply.
    Let Me explain again.
    In people search core results i want to show the results as follow-
    Employee name
    Designation
    Work phone
    Email id
    Departmet

    All the Information is coming from the AD but not able to show in the Results.
    What do i have to edit to show the desired results.
    Waiting…………….

    Ricky Singh

    April 23, 2008 at 10:29 am

  14. HI Everyone?

    I am also having the same requiement as Hina.
    I want to show the results as
    Employee name
    Designation
    Work ohone
    Email id

    I am able to get only that information of the employees who have their personal sites.
    Do i have to got to the shared Services and import the information of all the users from AD??
    Please help me out on this….

    sendil

    June 2, 2008 at 4:37 am

  15. Hi Richy, sendil

    Well I can understand your problems. I had the same requirement. But ok,… this is what I created:
    http://dl.getdropbox.com/u/19735/web/peoplesearch.jpg

    Not all the informations of one user comes from the AD. There are informations like “Autotyp” (Cartype) or “Autonummer” which are filled up in SharePoint after the User was for the first-time imported (updates from AD doesn’t remove the custom field-informations).

    Well, to create such a result for persons you have “just”to fullfill the five steps as Henry described above. But you need to know modifing XSL-specifications. Further the follow link my help:
    http://www.u2u.info/Blogs/Patrick/Lists/Posts/Post.aspx?ID=1669

    With such an XSL you get the XML-result. So you can easily create a XSL for your own result-page. For me this was a real great help. Because I had the most problems by resolve the XML-name of fields to get them on my page.

    Hope this helps (and I hope you understand my ‘ugly’ english) ;-)

    Adrian

    Adrian Bucher

    June 2, 2008 at 8:06 am

  16. Thanks for the post Adrian!!

    Henry

    June 2, 2008 at 6:58 pm

  17. I have a another issue not related to the current post but i thought one of you might be able to help on this. I am not able to either fix the height or width of the List view Webparts.Is there any way to correct this bug??

    Ricky Singh

    June 3, 2008 at 10:34 am

  18. Thanks Adrian, I was able to get the Search thing going through the XSL using Sharepoint Designer.

    Ricky Singh

    June 3, 2008 at 10:35 am

  19. I have another problem.
    I have site colection that is using only one content database but my site collection has many subsites and i want to check the size that each subsite is using in the database..is there any way that i can get the size of subsites?

    Ricky Singh

    June 5, 2008 at 9:45 am

  20. Ricky,

    I am looking to format my results page as well, but am having problems working with Designer to pull the info…can you help me with the XSL you used?

    Jay

    July 30, 2008 at 6:07 am

  21. When adding a column using the instructions generously provided by Henry, the following error message occurred in the core results web part:

    “An item with the same key has already been added.”

    After publishing the site, everything worked, but the message scared me a bit.

    By the way, you can extend Henry’s logic to replace the employee image with an image from a document library in the following way:

    Add the employee image to an image library (my client wanted to use lastnamefirstname.jpg convention). An example of the image URL is http://fqdn/HR/EmployeeImages/LastnameFirstname.jpg.

    Add the column names for lastname and firstname to the query as Henry instructs above.

    Edit the XSL and replace the image src={pictureurl} with image src=”http://fqdn/HR/EmployeeImages/{lastname}{firstname}.jpg”.

    This took me a while to figure out, so I hope it helps somebody else.

    Geno - USA

    October 16, 2008 at 8:18 pm

  22. Please note that the instructions provided by me are for replacing the images in the peopleresult.aspx search result page (in a SearchCenter with Tabs site).

    Geno - USA

    October 16, 2008 at 8:21 pm

  23. Hi Everybody,

    In our Active Directory , our profiles do not have the data for Skills and Responsibilities.
    We have imoprted the profiles to Sharepoint and are able to search users based on email,name and department only.
    How can we search based on the Skills and Responsibilities (we have updated our profile at MyProfile using MySite).

    Pradeepti

    November 11, 2008 at 2:05 am

  24. [...] Customise People Search Results [...]

  25. I’m having trouble getting “Manager” to display as well. Is there something special about Person type fields? My other changes are working fine.

    Derek J. Punaro

    January 12, 2009 at 10:58 am

  26. Hi,

    Is it possible to increase thumbnail picture size in people search result page and/or in My Site page?
    I’m using MOSS2007.

    Please help….

    Surachai

    February 15, 2009 at 11:40 pm


Leave a Reply