SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a content query web part displaying items from a list which includes an author column. I've managed to get the author's name and picture displaying, but I don't know how to get their department.

Currently I have this in my ItemStyle:

<xsl:template name="Testimonial" match="Row[@Style='Testimonial']" mode="itemstyle">
  <xsl:variable name="UserFieldLogin">
     <xsl:value-of select="ddwrt:UserLookup(string(@Person) ,'Login')" />
  <xsl:variable name="UserPicture" select="translate($UserFieldLogin,'\','_')"/>

  <div style="float: left; margin-right: 10px;"><img src="https://staffurl/User%20Photos/Profile%20Pictures/{$UserPicture}_LThumb.jpg" alt="" style="width:62px;"/></div>
  <h4><xsl:value-of select="@Person" /></h4>
  <xsl:value-of select="@Testimonial" disable-output-escaping="yes" />      
  <br /><br />

Can someone assist me in looking up other fields for the author??

Thanks very much!

share|improve this question
up vote 0 down vote accepted

The department will not be available in the same way sadly.

Create a placeholder using your XSLT then add some jQuery to the page and use that to grab the department using SPServices or similar then insert into the placeholder.

share|improve this answer
It's a shame there's not a better way to do this, but thanks for your suggestion - I'll have to give it go. – Averenix Mar 27 '13 at 22:17

Your Answer


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.