Recent

SharePoint Employee Directory

At the SPTechCon Boston conference this summer Stacy Deere-Strole did a great search session and ended it with publicly sharing a SharePoint display template with css that will transform your SharePoint people results page:
finished_corp_directory

This solution is posted on the ShareGate blog site which is an incredible blog that has quite a few amazing solutions such as this:
http://en.share-gate.com/blog

What I’ve tried to do with this post is to simplify the install steps for those of you who might be new to customizing SharePoint display templates.

Installing the Employee Directory Template

For simplicity we are going to edit the PeopleResults.aspx page that is a part of the Enterprise Search Centers template (This is a template that is only available on site collection creation, not subsites which has the Basic Search center template).

1. Go to the Sharegate blog and download the zip file (there’s a big orange Download the Files Now button near the bottom of the article).
http://en.share-gate.com/blog/corporate-directory-sharepoint-search
*
*The download link on their post doesn’t seem to be working, here’s a direct link to their zip files:
Corporate_directory_blog

2. Extract the 3 files and add the alpha and people-search files to a library on the Search Centers site.
emp-directory-1

3. Go to Site Settings for the Search Center and click on Master pages and page layouts:
emp-directory-2

4.  Click on the Display Templates Folder:
emp-directory-3

5. Click on the Search Folder
emp-directory-4

6.  Selection the files tab, click Upload Document
emp-directory-5

7. Browse to the ‘Item_Person_FPS.HTML’ file which you extracted in step 2.
emp-directory-6

8. Make sure the Content Type is Item Display Template.  Then either Check-in or Save the file (your option might be different based on publishing settings in your library).
emp-directory-7

9.  Sort the library view by Modified, descending.  This will list your newly added file first.  Then click the dropdown next to the Item_Person_FPS.HTML file and select ‘Publish a Major Version’ (Notice that SharePoint creates a Item_Person_FPS.js, don’t worry about this file as changes made to the hlml file automatically update the js file).
emp-directory-8

10.  Click the dropdown next to the Item_Person_FPS.HTML file again, IF there is an option for Approve/Reject, click it and approve the file.  If that option is not on the dropdown, all that means is your library isn’t forcing approval.
emp-directory-9

11. Go to the Site Contents for the Search Center, click on the Pages library.  Click on the peopleresults page:
emp-directory-10

12. Edit the page, go to the People Search Core Results web part and Edit Web Part:
emp-directory-11

13. Click on the Change query option:
emp-directory-12

14. Add a contentclass equals SPSPeople property filter to the Query text.  Your finished query should look like the one below.  Click the OK button to save your query.emp-directory-15

15.  Back in the web part properties, expand the Display Templates section, select Use a single template to display items, and select the People Item (Custom) display template.  The the OK button to save the web part settings.
emp-directory-17

16. Expand the settings section, enter 20 for the number of results per page.
emp-directory-27

17. Your search page will now look something like this, don’t worry we just haven’t applied the css styling yet.
emp-directory-18

18. Edit the search result page again, click on the Add a Web Part option above the People search box:
emp-directory-19

19. Add the Script Editor web part to the page.

emp-directory-22

20. Edit the Script Editor web part.
emp-directory-23

21. Click the Edit Snippet option
emp-directory-24

22.  Enter a link reference to the css file that you uploaded in step 2, your link reference should look something like this:
<link href=”../SiteAssets/people-search.css” rel=”stylesheet” type=”text/css” />

After inserting the link reference into the embed code area, click Insert to save.
emp-directory-25

Completed Example:

Your profiles should now be displaying with profile pictures and the person’s department, work phone, and email address:
finished_corp_directory-2

 

Adding Alpha filtering options to page

Note: Steps 23 – 26 are optional, these steps insert the alpha letters which allow you to filter the people by a last name letter.  In large organizations this doesn’t really work very well as just showing all employees who have the last name starting with H doesn’t narrow the view down sufficiently (there might still be 100’s of people).  But this probably would work well with smaller companies.

23. Click on the Add a Web Part option again.
emp-directory-19

24. Insert the Content Editor web part.
emp-directory-20

25. Insert the URL to the alpha.html file you uploaded in step 2.  Under the appearance section select the None Chrome Type.  Click OK to Save the web part.
emp-directory-21

26. Re-arrange the web parts so the Content Editor is below the Search box.
emp-directory-26

27.  I’d recommend editing the people-search.css file to decrease the margin and padding on the letters so they don’t wrap onto 2 lines so easily.
emp-directory-28

Completed Example with Alpha letters:
finished_corp_directory-3

 

 

 

 

 

 

 

About Nick Hurst (84 Articles)
SharePoint and Nintex developer who strives to find easy to deploy and maintain solutions for business problems.

8 Comments on SharePoint Employee Directory

  1. the download link on the page you referenced does not work. where can I get the display template files

    Like

  2. Thank you for your post, can you please send me files in the motioned link because I am not able to download them email: Kurdi.Salah@Gmail.com

    Like

  3. Hello Nick,
    thanks for uploading the files but I am still having an issue. I followed your directions but my search results still look like your results in step 17. the phone number and email address are off the screen with a “..” after it and the results are a in a single column just like step 17. I have uploaded the files to the places you said and followed the rest of the steps but that’s what my results look like. on top of that, I added the alpha (steps 23-26) and the letters show up at the top of the page in a vertical line going down, single column and the letters are not clickable. any ideas what I may have done wrong?

    Like

  4. Thank you so much my friend

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: