Has anyone found a way to automatically add a jslink URL to lists by default instead of having to add the URL to every list manually when they are created? Ultimately we'd like to have default jslink for each type of app the editors have access to.
SharePoint online - how to include jslink by default for all lists?
842 Views Asked by three7studio At
2
There are 2 best solutions below
0

yes, this was described perfectly by Chris O'Brien here: http://www.sharepointnutsandbolts.com/2013/01/using-jslink-to-change-ui-of-sharepoint_20.html
short story - you should create list template and define jslink there, so all lists based on this template would have the js link. If you don't want to assosiate lists with templates by any reason, you should look into event receivers. (for List created event.)
Another solution is to write your own code to update all of your pages. On this page Tobias Zimmergren shows a code updating JSLink with PowerShell: PowerShell: Configure the JSLink property of a Web Part
I personally use C# CSOM to update JSLink on all requested pages. Here is the sample code which updates JSLink on one page (for simplicity I have stripped out exception handling and all non-happy-path logic):