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

   <table cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <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>
...
            </td>
        </tr>
        <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}" />
                    </a>
                </td>
            </xsl:if>
            <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>)
            </td>
        </tr>
    </table>

share|improve this question

1 Answer 1

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

 
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.