Thursday 9 February 2012

How to Change the link as a Image in sharepoint designer web part ?

1. We want to select the binded url in web part

2. Select the following image hyperlink option link

3. Then popup the following message




4.Select Yes and then choose the site location image and then edit the web part the following source code

  
<xsl:choose>
<xsl:when test="$desc=''">
<xsl:value-of select="$url" /></xsl:when>
<xsl:otherwise>
<a href="{$url}" ></a></xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>

5.Then change the following way the above code

<xsl:choose>
<xsl:when test="$desc=''">
<xsl:value-of select="$url" /></xsl:when>
<xsl:otherwise>
<xsl:variable name="positeurl" select="substring-before($desc, '/Purchase%20Order')"/>
<xsl:variable name="positeimgurl" select="concat($positeurl, '/Style%20Library/Images/img-icon-discuss.png')"/>
<a href="{$url}" ><img alt="" src="{$positeimgurl}" border="0" /></a></xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>

6. Save & Close it.











No comments:

Post a Comment