How to Link Author name to profile Picture using xslt:
Now bellow <xsl:styleSheet tag Create parameters as bellow
<xsl:param name="PageUrl"/>
<xsl:param name="SiteUrl"/>
<xsl:param name="WebUrl"/>
PageUrl will contain the url of the page . SiteUrl will contain Url to Site. Web Url contain url to web.
you can concat SiteUrl and WebUrl to get WebUrl as below.
First declare a variable and perform a user lookup on the account name of the user.
<xsl:variable name="authoraccount">
<xsl:value-of
select="ddwrt:UserLookup(string(@Author) ,'Login')" />
</xsl:variable>
Now as we have account I can link it to
sites person.aspx
<xsl:variable name="FinalUrl"><xsl:value-of select="concat($SiteUrl,$WebUrl)"/>
</xsl:variable>
Please Contact <a
href="{$FinalUrl}/_layouts/userdisp.aspx?accountname={$authoraccount}&Source={$PageUrl}"><xsl:value-of
select="@Author"></xsl:value-of></a>
No comments:
Post a Comment