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!

1 Answer 1


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.

  • 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, 2013 at 22:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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