Custom XSL for SharePoint List View Web Part

How to safely override Out-Of-The-Box (OOTB) XSLT List View with three column of Multiple lines of text - Rich Text - Append Changes to Existing Text:

Before:
XSLT List View with three column of Multiple lines of text - Rich Text - Append Changes to Existing Text
Applying custom XSL:
 After:
Custom XSL:

<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal" xmlns:o="urn:schemas-microsoft-com:office:office"> <xsl:include href="/_layouts/xsl/main.xsl"/> <xsl:include href="/_layouts/xsl/internal.xsl"/> <xsl:template name="FieldRef_Note_body.Comment" match="FieldRef[@Name='Comment']" mode="Note_body"> <xsl:param name="thisNode" select="."/> <div class="trim-append-only-history"> <SharePoint:AppendOnlyHistory FieldName="Comment" runat="server" ControlMode="Display" itemid="{$thisNode/@ID}" /> </div> </xsl:template> <xsl:template name="FieldRef_Note_body.V3Comments" match="FieldRef[@Name='V3Comments']" mode="Note_body"> <xsl:param name="thisNode" select="."/> <div class="trim-append-only-history"> <SharePoint:AppendOnlyHistory FieldName="V3Comments" runat="server" ControlMode="Display" itemid="{$thisNode/@ID}" /> </div> </xsl:template> <xsl:template name="FieldRef_Note_body.Issues_x0020_and_x0020_decisions" match="FieldRef[@Name='Issues_x0020_and_x0020_decisions']" mode="Note_body"> <xsl:param name="thisNode" select="."/> <div class="trim-append-only-history-to-first-div"> <SharePoint:AppendOnlyHistory FieldName="Issues_x0020_and_x0020_decisions" runat="server" ControlMode="Display" itemid="{$thisNode/@ID}" /> </div> </xsl:template> </xsl:stylesheet>

Comments

Popular posts from this blog

How to migrate SharePoint Online SPWeb with custom SPList form (PowerApps) and Flows

How to setup SharePoint Online Development Environment (Part 2)

How to extract Infinity Intelledox Log using SQL statement