Displaying ‘Person’ Columns with Presence in a Data View

27 Jan

(The title of this post could also be: "How to disable output escaping of the columns in your SharePoint Data View from SharePoint Designer")

You may have tried to use a list with a Person column as the source for a Data View.  You may have even had Presence information available in that column.

It's likely that all you got was a bunch of garbled HTML when you actually rendered the column.  This is because by default, the XSL transformation will escape all the HTML characters rendered for the "People" column type.  With a simple attribute in your XSL you can fix this, and show single and multiple Person entries correctly.

If you look in your code view in SharePoint Designer where the column is rendered, you'll see a simple value-of select like this:

Simply modify that by adding an output escaping attribute:

And now it should render the column properly.  This will work for any data type that contains HTML.

Leave a Reply

Your email address will not be published. Required fields are marked *