0

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>

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 :)

  • 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 :) – user2536 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! . – user2536 Feb 15 '12 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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