Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In a custom Xsl file, used in a ContentByQueryWebPart, I would like to display some user fields with the presence indicator.

If I put <xsl:value-of select="@Author"/>, I get only the display name of the user.

Is there a simple way to render the user with its presence?

[edit] A minimal, reproductible xsl is :

<xsl:template name="MyStyle"
            mode="itemstyle"
            match="Row[@Style='MyStyle']">
    <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
            <xsl:value-of select="@Author"/>
</xsl:template>
share|improve this question

1 Answer 1

up vote 1 down vote accepted

If you check the standard ItemStyle.xsl then there is a reference to CallPresenceStatusIconTemplate.

<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>

Give this a try? Or perhaps check out what it does and see if you can reproduce it?


Hmmm - looks like this might be legacy from 2007

If the @SipAddress attribute exists on the current row, it generates the appropriate markup to create a presence icon for Microsoft Office Outlook 2007 or Microsoft Office Communicator 2007

There is a really good walk through how get a presence icon with 2010 on Ben Prin's blog:

http://benprins.wordpress.com/2012/07/30/presence-and-user-profile-url-with-xslt/

share|improve this answer
    
I've seen this template, but I don't know how to link it to my specific user field. –  Steve B Mar 12 '13 at 11:21
    
Sorry for the long delay, I miss the SO notification. The link you provided helped me to solve my issue. thanks –  Steve B Apr 15 '13 at 14:30
    
That is great news - well done! –  Dave Paylor Apr 18 '13 at 11:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.