Creating a staff Directory in SharePoint Part 2 - People Search

In part 1 we looked at creating a Staff Directory using the User Information List. This time we'll attempt it with the People Search.

To begin with obviously we need to be able to search find people using the search. I have already set up a site using the Search Center  site template. The only problem is I am getting no results when searching for people.

I followed these instructions. -

and it now works.


The first thing we can explore is what happens when we click edit on the page. Remembr that the search results page is actually a publishing page which is why it sits in a /pages directory.


Looking at this page in edit mode can provide some insight into what all those search web parts in the web parts gallery do. The capabilities of this page are beyond the scope of this article but will definitely be revisited in another article.

One of the requirements of the staff directory is that users should be able to click on a letter like this..


This was easily achieved by modifying the script found here -

to look like this.


peoplesearch.txt (1.85 kb)

Next we want to customise the layout of the search results themselves. As with most of the web parts you will need to edit the XSL. Before you do though note that there appears to be a bug that throws an error every time you edit the XSLT. You can ignore it but unfortunately you can't see any changes you make until you publish the page. More info here -

Instructions on customisation can be found here - and here -

I was going to provide some of these instructions myself but these articles explain them really well.

Just to add a few finishing touches we can adjust the search dropdown options by mofidying propeties of searchbox.


I added favourite Cake and it now looks like.


Creating a staff Directory in SharePoint Part 1 - User Information List

Staff directories are a very common request for Intranets. Oddly SharePoint doesn't have a feature called Staff Directories but it contains many bits and pieces that can help build one.

i.e People Search, Custom user properties, My sites, People and Groups page.

There are also out of the box solutions that you can purchase from such as

Or you can write code such as

This article is to demonstrate how far we can go with just out of the box configuration trying various methods.

Method 1 - Using the User Information List 

################### Read this First ################################

Before you try this at home, please note that this solution is very limited. I am making notes as I attempt various methods and these articles are my findings not neccesarily the best solutions.

A better solution is found in part 2 of this article -

Pros of this method

  • Very easy to set up
  • Does a good basic job 
  • Some decent styles and info available OOTB


  • Can't create own styles
  • Content doesn't synch with SharePoint Profiles (This may be fixable with Bamboo Solutions User Sync)
  • As users are removed from SharePoint they still remain in this list (This may be fixable with Bamboo Solutions User Sync)
  • Can't edit the page that results appear on. E.G Can't add web parts.
  • Can't search for users. Can only group by SharePoint groups.
  • When users update their details in MySites it takes a while for the UIL to reflect the changes. This is because syncing is done by a Timer Job called "Profile Synchronization" which runs by default once an hour.

 More info:

As part of the experiment I will use the Personalization Site Template to create a dedicated Staff Directory site for no particular reason other than I want to see what this site template does.

So here is what the new site looks like. It is just a normal site but it contains a couple of filters preloaded on the  page. It also applies a link to this area directly to the creators mysites section.

Now let's go to the People and Groups page and see what our options are.


In this image you can see that I have actually jumped a few steps ahead.

Really all that I have done is created a few groups - Sales, Marketing etc. Under Settings -> 'Edit Group Quick Launch' you can define which groups to show in the Quick Launch on the left.
In our example the client would like to be able to browse by department so we can either create groups to represent each department or perhaps these departments already exist if you are using AD.

Next notice in the top right dropdown that we have created a new view called Staff Directory. You could create as many views as you like perhaps even filtering by location. Or alternatively instead of using the groups in quick launch you could use the views to filter by dept instead.

Note: For some reason list settings option only appears from the top level site which is where you go to create custom views.


Here is where we start the limitations of this approach. You can create a new view but the properties that are displayed in that view seem to be limited to these.


Not sure at this point if you can add more. This may not be a huge limitation as all we areally want this view fo ris to display some basic info about the users and if they want more they can really click through to the user MySite page.

The other bit of customisation for this view is that you can select different styles for displaying the info. 

I'm trying to find if you can create your own styles but can't find any info.

You can open any of the views of the UIL from SharePoint Designer by opening the root site but the only options available appear to be the same as you get from the browser view.

On thing I noticed is that a ListViewWebPart is used to display the info but can't find any info on editing styles for LVWP either.

At this point this solution is not looking flexible enough for me so I am abandoning it and moving onto trying the People Search instead in part 2 of this artilce.


Editing skins with SharePoint Designer

7. April 2009 08:56 by sashashev in reskining, SharePoint Designer  //  Tags: , ,   //   Comments (0)

Editing skins with designer can be frustrating due to the many quirks in the process.

For a good starting point read here -

Some additional tips.

After you edit CSS files don't swich themes until you copy all your changes back to the theme.css file in the 12 hive otherwise SharePoint will overwrite your changes.

Every time you change themes SharePoint puts a local copy of the theme folder copied from the 12 hive which overwrites the current themes folder.

Only 1 theme folder per site collection appears in Designer.

Also as an extra note in the Masterpage section of sesttings, the system Masterpage option is used for the document center masterpage.

It appears the difference between the SIte Master Page and System Master page is primarily the quick launch. Which becomes the treeview in the System Page.




Creating custom landing pages in SharePoint Part 1 - TheTable of Contents Webpart

The mission: Create a default landing page for each publishing site to aid in navigation.

The landing page should contain 2 sections.

  1. A section that lists all sites directly below the site you are on (1 level)
  2. A section that lists all the pages in the pages folder.
To pretty things up we may want to show images and/or descriptions for sites and pages.
The images and descriptions should be pulled from the image and description field the user enters when creating the new subsite or page.

Method No 1- Using the Table Of Contents Webpart

Note: Please read conclusion of this article to see why this solution didn't meet my requirements.

An obvious place to start is to see what we can do using the built in Web Part purpose built for our task.

The table of contents webpart provides a quick an easy method to display a Table of Contents. (Believe it or not)

It has cool features such as..

  1. Pick from which level to start the TOC
  2. Style your TOC 
  3. How many levels to show

More on the TOC web part can be found here and here

As we want this page to be a template with the contents starting from the current site we use SharePoint Designer.

Page templates reside in the same folder as Masterpages. 

_catalogs >  masterpage


To keep things seperated I have created 2 subfolders. Custom > Layouts and my new layout page is called WelcomeTOC.aspx.

I created this page by making a copy of one of the existing Welcome Pages.(I can't remember which but any layout will do)

I then added a TableOfContentsWebPart into the first WebpartZone. I'm not sure whether you need the ZoneTemplate tags.

<PublishingWebControls:TableOfContentsWebPart runat="server" 
Title="Table of Contents" 
MissingAssembly="Cannot import this Web Part." 
Level1Style="Vertical with descriptions">
<Level LevelNumber="1" Path="/Site1" Title="Site 1" BeginColumn="true">
<Item LevelNumber="1" Path="/Page1" Title="Page 1" />
<Item LevelNumber="1" Path="/Page2" Title="Page 2" />
<Item LevelNumber="1" Path="/Page3" Title="Page 3" />
<Level LevelNumber="1" Path="/Site2" Title="Site 2" BeginColumn="true">
<Item LevelNumber="1" Path="/Page1" Title="Page 1" />
<Item LevelNumber="1" Path="/Page2" Title="Page 2" />
<Item LevelNumber="1" Path="/Page3" Title="Page 3" />
<xsl:stylesheet xmlns:x="" version="1.0" xmlns:xsl="" 
xmlns:cmswrt="" exclude-result-prefixes="xsl cmswrt x"> 
<xsl:import href="/Style%20Library/XSL%20Style%20Sheets/Header.xsl" /> 
<xsl:import href="/Style%20Library/XSL%20Style%20Sheets/LevelStyle.xsl" /> 
<xsl:import href="/Style%20Library/XSL%20Style%20Sheets/TableOfContentsMain.xsl" /> </xsl:stylesheet></Xsl>

The important thing to note here is the

AnchorLocation="" attribute.
This sets the starting location of our links to the current site.
Customising the layout

Customising the layout is similar to customising the layout for other web parts such as the RSS reader or Custom Query web part. You need to do some XSLT.

You can edit 3 files

  • Header.xsl
  • LevelStyle.xsl
  • TableOfContentsMain.xsl

These files reside in Style Library > XSL Style Sheets


You can read more info here -



Basically you can alter the layout but the TOC web part is very limited as it only outputs the @Title, @Description, @LevelNumber and@Path.

This is OK if you just want some basic text but this won't cover our needs to display a possible image for each site or page listed.

A neat trick for verifying this is to add the following to your XSLT transformation in the LevelStyle.xsl file.

This will output the raw XML in between the <rawdata> tags.

That way you can see all the data you have to play with. I suspect this will work in the other xsl files in Sharepoint.

   <xsl:template name="ShowAll" match="Level[@LevelTemplate='ShowAll']">
    <xsl:copy-of select="*"/>

When you view the source of your page you will something like..

<Item Description="I am happy to announce " LevelNumber="1" Path="/News/Pages/mypage.aspx" Title="Title of my page"></Item>

Further reading:
Customizing Styles of Summary Links, Table of Contents, and Content Query Web Parts

Webcoda, SharePoint Consultants & Web Development

SharePoint Development Sydney is a crack team of SharePoint Consultants and SharePoint Developers.

We can't tell you their names or show their faces on TV but if you need a SharePoint job done right, call them on +61 2 9370 3602 or email us at

Persecuted by the Government and shunned by society they developed their SharePoint skills in back streets and labor camps where other programmers wouldn't dare to tread. 

During a trek through the Himalayas they stumpled upon the fabled Mossy Yak who shared his SharePoint knowledge of how to attain Nirvana through a series of Workflows and Event Handlers. Their mission is to spread this knowledge through-out the world to bring peace, harmony and document version control to all .


Month List