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 am trying to create custom query in SP2010 called company announcement. I would like to include the profile picture of the author from the sharepoint user profile. Any help would be great! _blank

    <xsl:variable name="bodyContent">
        <xsl:call-template name="removeMarkup">
            <xsl:with-param name="string" select="@PublishingPageContent"/>

   <table cellpadding="0" cellspacing="0" width="100%">
            <td class="S2StyleTitle" colspan="2">
                <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>     
                    <a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
                    <strong><xsl:value-of select="$DisplayTitle"/> - <xsl:value-of select="$Created"/></strong></a>
        <tr class="S2StyleBorder">
            <xsl:if test="string-length($SafeImageUrl) != 0">
                <td class="S2StyleImage"> 
                    <a href="{$SafeLinkUrl}" target="{$LinkTarget}">
                        <img class="image" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" />
            <td class="S2StyleDescription" valign="top">
               <xsl:value-of select="substring($bodyContent,1,100)"/>... (<a href="{$SafeLinkUrl}" mce_href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">more</a>)

share|improve this question

This article might give you a pin-point at what you need to do to achieve this.

By using jQuery and ECMAscript in addition to the XSLT this should be possible. Haven't tried it myself, but it looks promising.

I hope it helps! :)

An alternative would be to create a custom CQWP, inheriting the sharepoint CQWP and then provide the userprofile information through that. I've done that myself a few times to pass parameters that I couldn't do otherwise. Might give that a shot :)

share|improve this answer
Not too familiar with Jquery and ECMAscript I may need to keep looking – Nick Feb 15 '12 at 20:01
@Nick Look at my update :) – Daniel Ziga Feb 15 '12 at 20:15
Thanks for the update do you know what the variables would look like...sorry fairly novice here. – Nick Feb 15 '12 at 20:30
@Dandroid...I may have found a workaround. I created a new column and did a Workflow to update the picture via Workflow and added with the general settings. – Nick Feb 15 '12 at 20:34
@Nick That could work. Please let me know if it works out for you with the workflow! . – Daniel Ziga Feb 15 '12 at 20:50

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.