1. This is the sample list which is currently displaying full text from multiple line of text field “Remarks"
2. Open the site in SharePoint designer , navigate to the list default view page.(In this example we are using AllItems.aspx page)
3. Right click on the List View Web Part and select “Convert to XSL T Data View”. This will automatically convert settings for the current view into data view parameters.
4. After converting to XSLT, select the remarks field and switch to code view, you will see the code to display the remarks field as below
<xsl:value-of disable-output-escaping="yes" select="@remarks" />
</div></TD>
We need to change the above line of code as below
<TD Class="{$IDAXNQ1G}" style="height: 22px">
<div dir="{ddwrt:GetVar('Direction')}" title="{@remarks}">
<xsl:choose >
<xsl:when test="@remarks != ''" >
<xsl:value-of disable-output-escaping="yes" select='concat((substring(@remarks,1,20)),"...")' />
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="@remarks" />
</xsl:otherwise>
</xsl:choose>
</div></TD>
5. Save the file. Now you will see the trimmed text in the default view page
No comments:
Post a Comment