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

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>
  <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 />
</xsl:template>

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

Thanks very much!

share|improve this question
add comment

1 Answer

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
add comment

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.