in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

JoeD

Displaying Users with Presence in XSLT Data View

In a list, you can create a field of type "Person or Group" and set the "Show data" option to "Name (with presence)".  When the field displays the user's name, it shows the Office Communicator presence "globe" to the left of the name.

If you use SharePoint Designer (SPD) to convert a List View to an XSLT Data View, fields that display as "Name (with presence)" do not display correctly.  Instead you see HTML tags that would display the name with the presence globe.

You can fix this by switching the SPD view to the Code (or Split) view.  Find the XSL code that will display the name field:

<!--PM Responsible--><TD Class="{$IDAEHOAF}"><span><xsl:value-of select="@PM_x0020_Responsible" /></span></TD>

In the xsl:value-of tag, add disable-output-escaping="yes":

<!--PM Responsible--><TD Class="{$IDAEHOAF}"><span><xsl:value-of disable-output-escaping="yes" select="@PM_x0020_Responsible" /></span></TD>

SPD adds this attribute for some fields, but not all.  You need it for any field that may be rendered by Sharepoint as HTML.

I've found that disable-output-escaping also needs to be added for lookup fields.  Values in lookup fields are rendered as hyperlinks to the list item in the lookup list.  If the value in the lookup field contains special HTML characters (such as &), they are rendered as the "escaped" representation (such as &amp;).  For example, the value "T&M" would display as "T&amp;M" unless disable-output-escaping is added.

 

Published Mar 17 2008, 10:04 AM by joed
Filed under: , ,

Comments

 

Dustin Miller said:

You can also use the quick tasks menu for that item in the data view, and change it's display style to "rich text". :)

March 17, 2008 10:37 AM
 

SharePoint Link Love: 03-18-2008 at Virtual Generations said:

Pingback from  SharePoint Link Love: 03-18-2008 at  Virtual Generations

March 18, 2008 7:19 AM
 

Links (3/18/2008) « Steve Pietrek’s SharePoint Stuff said:

Pingback from  Links (3/18/2008) &laquo; Steve Pietrek&#8217;s SharePoint Stuff

March 18, 2008 8:55 PM
 

arshad said:

Hi,

I changed list control to XSL Data View and then updated a hyperlink on an image. These changes are not applying to the main site. When I tried to switch back it remove all the changes. Anybody can help me what should i do.

Anticipated thanks,

arshad

April 24, 2008 3:28 PM
 

Aron said:

Anyone know how to disable the presence using sharepoint desiger. I've got a dataview that resembles a scorecard with red/yellow/green statuses, but the presence indicators get in the way! I know all the hookups if you're an admin, but I'm not thus I don't have access to the .js file that initates this.  I've been trying to mess with the xsl and asp query values.  I can't find anything on the web.

May 12, 2008 12:41 PM

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts