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:
This solution is posted on the ShareGate blog site which is an incredible blog that has quite a few amazing solutions such as this:
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).
**The download link on their post doesn’t seem to be working, here’s a direct link to their zip files:
2. Extract the 3 files and add the alpha and people-search files to a library on the Search Centers site.
3. Go to Site Settings for the Search Center and click on Master pages and page layouts:
4. Click on the Display Templates Folder:
5. Click on the Search Folder
6. Selection the files tab, click Upload Document
7. Browse to the ‘Item_Person_FPS.HTML’ file which you extracted in step 2.
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).
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).
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.
11. Go to the Site Contents for the Search Center, click on the Pages library. Click on the peopleresults page:
12. Edit the page, go to the People Search Core Results web part and Edit Web Part:
13. Click on the Change query option:
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.
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.
16. Expand the settings section, enter 20 for the number of results per page.
17. Your search page will now look something like this, don’t worry we just haven’t applied the css styling yet.
18. Edit the search result page again, click on the Add a Web Part option above the People search box:
19. Add the Script Editor web part to the page.
20. Edit the Script Editor web part.
21. Click the Edit Snippet option
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.
Your profiles should now be displaying with profile pictures and the person’s department, work phone, and email address:
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.
24. Insert the Content Editor web part.
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.
26. Re-arrange the web parts so the Content Editor is below the Search box.
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.
Completed Example with Alpha letters: