1

I have an Announcement Webpart added in my pages I want to add Read more link blow each item I searched the net they give this xsl code blow:

<xsl:template name="removeMarkup">
   <xsl:param name="string" />
   <xsl:choose>
   <xsl:when test="contains($string, '&lt;')">
          <xsl:variable name="nextString">
                 <xsl:call-template name="removeMarkup">
                 <xsl:with-param name="string" select="substring-after($string, '&gt;')" />
                 </xsl:call-template>
          </xsl:variable>
          <xsl:value-of select="concat(substring-before($string, '&lt;'), $nextString)" />
   </xsl:when>
   <xsl:otherwise>
          <xsl:value-of select="$string" />
   </xsl:otherwise>
   </xsl:choose>
</xsl:template> 
<xsl:template name="ReadMoreAnnouncements" match="Row[@Style='ReadMoreAnnouncements']" mode="itemstyle">
<br />
<div class="RMAnnouncementsTitle">
    <xsl:value-of select="@Title" />
 </div>
 <div class="RMAnnouncementsBody">
    <xsl:variable name="bodyContent">
        <xsl:call-template name="removeMarkup">
            <xsl:with-param name="string" select="@Body"/>
        </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="substring($bodyContent,1,190)" />
    ...
    <br />
    <a>
        <xsl:attribute name="href">
            /Lists/Announcements/DispForm.aspx?ID=
            <xsl:value-of select="@ID">
            </xsl:value-of>
        </xsl:attribute>
        <xsl:attribute name="class">
            RMAnnouncementsMoreLink
        </xsl:attribute>
        read more
    </a>
 </div>
</xsl:template>

I have putted in my ItemStyle.xsl before

but it don't shows read more link. please any help will be appreciated.

Your Answer

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

Browse other questions tagged or ask your own question.