Matthew McDermott

Matthew is a principal consultant for Catapult Systems. A Microsoft MVP (SharePoint Server), Matthew blogs about SharePoint and Microsoft technologies related to collaboration, web content management and productivity.
RSS Feed

Mobile People Search

Every so often I get asked about creating a corporate phonebook or mobile phonebook for SharePoint. I have been doing a lot of planning sessions this week and needed something creative to do, so here's something fun.

I decided to create a lightweight people search page for mobile devices.

People Search 

I created the page starting with an regular ASPX page. After adding a web part zone I dropped a People Search Box and People Search Core Results web part. I finished it up with a little CSS and this is the result.

Search Results

The best part is that you don't need to be an administrator to implement a solution like this. Just upload the files to any document library and you're good to go. Here are some of the finer points...

Create the Page

  1. Open a document library in SharePoint Designer. Choose File | New | ASPX.
  2. Give the page a name and open the page for editing.
  3. Replace the with page tag "<%@ Page Language="C#" %>" with:
    <%@ Page language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,
    Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,
    PublicKeyToken=71e9bce111e9429c"

    meta:progid="SharePoint.WebPartPage.Document" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,
    PublicKeyToken=71e9bce111e9429c"
    %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,
    PublicKeyToken=71e9bce111e9429c"
    %> <%@ Register tagprefix="SPSWC" namespace="Microsoft.SharePoint.Portal.WebControls"
    assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral,
    PublicKeyToken=71e9bce111e9429c"
    %> <%@ Register tagprefix="WebControls" namespace="Microsoft.Office.Server.Search.WebControls"
    assembly="Microsoft.Office.Server.Search, Version=12.0.0.0, Culture=neutral,
    PublicKeyToken=71e9bce111e9429c"
    %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     
  4. Add a web part zone by choosing Insert | SharePoint Controls | Web Part Zone. Your page should look like this in SPD.

image

Add Web Parts

  1. You only need two web parts to make this work. Drop a People Search Box and a People Search Core Results Web part.
  2. Change the Target search results page URL to point to your page, so that the query will just return this page.
  3. Uncheck Show Search Options.
  4. I removed the RSS feed by setting the results DisplayRSSLink property to false.
  5. View your page and you should see something like this:

Raw Results

Click-able Phone Numbers

At this point I browsed the page with my phone. I use an HTC phone with Windows Mobile 5. I was disappointed to find that my phone did not recognize the numeric pattern of my phone number. The whole point of this exercise is to click the phone numbers and have my phone dial. The solution was simple, though it took a while to find. The "tel:" hyperlink is read by the phone as a click-able link.

  1. Open the XSL for the Core Results Web part and locate the DisplayOfficeProfile template.
  2. Locate the code:
    <xsl:value-of select="$phone" />
  3. Change the code to:
    <a href="tel:{$phone}"><xsl:value-of select="$phone" /></a>
  4. Refresh your page and your phone numbers should now be rendered as hyperlinks.

Wrap It Up

Configuring the page and making it work took a few minutes. Formatting the page and painstakingly applying the CSS took a couple hours, though I think you agree that it is worth the effort. I added a few extra bells and whistles. I placed a named link at each level of My Colleagues, My Colleagues Colleagues, and Everyone Else. I set it up so when I click 1 the screen jumps to My Colleagues; 2 My Colleagues Colleagues; 3 Everyone Else; * back to the top. I also removed the links to the personal sites and presence indicator, though I plan to install Mobile Communicator so I can play with that...later.

Here are the files: Mobile People Search Files

Posted by Matthew McDermott on Saturday, 27 Sep 2008 09:00
5 Comments | Filed under: CSS, Search, My Sites
Bookmark this post with:        

Comments

On 30 Sep 2008 11:52, Paula James said:

Now this is very interesting. I'll definitely try this out and share this with friends. :) Thanks.

On 01 Mar 2009 01:16, Maria del Rosario said:

This is really great. Do you know if it only works on Windows mobile devices, or will it work on say an iPhone or Blackberry?

On 02 Mar 2009 08:09, Matthew said:

Maria, we tested it with Blackberries and it works fine, provided you can get your BB to authenticate with SharePoint. On the iPhone authentication is easy and it works fine (though I wish there was a way to store credentials.)

On 04 Sep 2009 12:08, Bharath said:

Hi Matt, I've gone through with your blog. It's pretty interesting and certainly a wonderful stuff. Hat's off for it. Can you provide me an extra info like whether after the results obtained from the search, can the contact number be used for direct calling purpose either the Phone line or Mobile line directly from the search page. Please assist me

On 04 Sep 2009 08:56, Matthew said:

Bharath, The tel: protocol prefix will render a clickable phone number for any telephany enabled device. So the answer it, "it depends". It works on mobile phones, I tested iPhones, Blackberries and Windows Mobile phones. It also works on computers that have telephony enabled applications like Microsoft Communicator. M

Comments are disabled