Showing posts with label LVWP. Show all posts
Showing posts with label LVWP. Show all posts

Wednesday 1 August 2018

JSLink on Modern Sites

Problem:  I want to use JSLink/CSR to amend a view on a list for a client on SharePoint Online/O365 and I can't find the JSLink property on the List View Web Part to perform simple Conditional formatting on a column.  JSLink as brilliant for achieving this task in SP 2016 and 2013.
Hypothesis: Modern sites use the Modern List View Web Part that is a new implementation of the LVWP.  https://techcommunity.microsoft.com/t5/Microsoft-SharePoint-Blog/Introducing-SharePoint-modern-list-library-web-parts/ba-p/64581  I assume pragmatically 1 can still use JSLink, but on "modern" pages this needs to be verified.

Resolution: Use "Column Formatting" as outlined here: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#get-started-with-column-formatting





Sunday 13 June 2010

XSLT List View Web Part (XLV)

Overview:
SharePoint 2010 has a heavy reliance on the Xslt List (XLV) View Web Part (WP). The replaces the MOSS List View Web Part (LVWP). In MOSS the Content Query Web Part (CQWP) was heavily utilised and the XLV WP is often a better option in SP 2010.

The old LVWP used CAML to provide custom views of the data/lists. Customising the XLVWP display is is done using xslt.

XLVWP has a default xslt for display located in the 14 hive at _layouts/xsl/main.xsl
main.xsl uses vwstyles.xsl and fldtypes.xsl that does most of the work on all the XLVWP in your SP farm.

Note. "XSLT is schema dependent because it iterates through the list of columns by naming each one explicitly. Using XSLT, the schema of the rendered list is fixed; it’s not possible to change the set of fields without changing the XSLT." - Eric Andeen.

XLV WP model - How it works

A custom xslt can either be placed ina style library or in th 14 hive.
Using SharePoint Designer (SPD)2010, you can customise the the XLVWP

More Info
SPD 2010 working with XLVWP
XSLT customisation
Customise the XLVWP
Connected Web Parts (XLVWP)