Hi I have a DataForm Webpart and editing in SPD.
I need to truncate a column so I've replaced this line
<xsl:value-of select="@AboutUsDetailedIntroduction" disable-output-escaping="yes" />
with this:
<xsl:value-of select="substring(@AboutUsDetailedIntroduction, 1, 499 + string-length(substring-before(substring(@AboutUsDetailedIntroduction, 500),' '))) " disable-output-escaping="yes" />
This seems to work, but I also require to add a link, as a test I've just added text but SPD seems to break and i get duplication of items as a result. It happens when I add a link or text after the line, however it appears to work above the line.
<xsl:value-of select="substring(@AboutUsDetailedIntroduction, 1, 499 + string-length(substring-before(substring(@shAReAboutUsDetailedIntroduction, 500),' '))) " disable-output-escaping="yes" /><a href="">Test Link</a>
I need to add a '... Read More' with a link, ideally shown when more info is available. how can this be achieved?
UPDATE I've tried another option but same problem occurs if I add any text after line 3. It works if set disable-output-escaping set to no. But then get html tags included in output, something I want to avoid. SPD adds additional code after saving if I add anything after line 3 which gives undesired results.
<xsl:choose>
<xsl:when test="string-length(@AboutUsDetailedIntroduction) > 500" >
<xsl:value-of select="substring(@AboutUsDetailedIntroduction, 1, 500)" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@AboutUsDetailedIntroduction" />
</xsl:otherwise>
</xsl:choose>
a
tag. Also put a space before thea
tag.