XSLT get email address from person field

4 03 2010

In this brief post I will show you how to use xslt to get someone’s email address from the people picker in a SharePoint list. Before I begin I must give credit to David Botschinsky who I met at the BETT show in January. He came to me and asked about getting the email address of a person from the person lookup field in a list – He wanted to achieve this purely through the browser if possible with no code. I had a quick think and couldn’t find a way. I then received an email from David saying he did it through SharePoint designer in the end and it’s this I will share with you:

In SPD create a XSLT view of the list with the person field in. The usual <xsl:value-of select=’@person’ disable-output-escaping=”yes” /> code will return the familiar link that goes to the user information page. By changing the  ‘disable-output-escaping’ to ‘no’ you will return all the code behind this link- including the email address! Then with some xslt sub-string magic you can strip out all but the email address.

<xsl:value-of select= 'substring-before(substring-after(@person, concat("sip=",$dvt_apos)), $dvt_apos)' disable-output-escaping="no"/>

That is all there is to it!





SharePoint Designer Settings in SharePoint 2010

11 02 2010

  We have engaged Sam Dolan http://www.pinkpetrol.com/ a SharePoint design specialist to help brand our SharePoint 2010 sites in readiness for our role out later this year. As Sam started work on the demo site last night I had a twitter conversation with him as he did not have access to the master page and it was only when I checked in

Central Admin -> General Application Settings -> SharePoint Designer

That I found that there are 4 settings boxes and out of the box only one is enabled the settings are:-

Allow SharePoint Designer to be used in the web application (On by default)

Allow site collection administrators to detach pages from the site template

Allow site collection administrators to customize master pages and layout pages

Allow site collection administrators to see the URL structure of their website

 After enabling the Customize master pages Sam was able to continue with the work. It seems that Microsoft are tightening security setting all through their product range which I must admit is not a bad idea, gone are the days of creating a share on a server and have everyone full control over the share.

SharePoint Designer settings

Dave








Follow

Get every new post delivered to your Inbox.