skip to Main Content

Customising the Content Search Web (Part 3): Going Old Skool with XSLT

This is the third post in a series I will be writing on the Content by Search Web Part (aka CSWP):

  1. What you get in the box
  2. Custom Display Templates with JavaScript
  3. Going Old Skool with XSLT (this post)
  4. Packaging & Deployment in Visual Studio

Now I am admittedly going to cop out here. I was originally intending to write this up in detail but to be honest it has already been done (very well) before.

So I would invite you to read the most excellent blog post from Waldek Mastykarz (@waldekm):

Using server-side rendering with Content Search Web Part in SharePoint 2013

He not only shows you how to hook up your JS Display Template with a server-side XSL file, but also shows you how to deploy the files and its primary usage (as a Search Crawler output).

If you want to use this method for all of your web requests then you can set theAlwaysRenderOnServer property of the CSWP to “true” and it will always use your XSL template file.

Next in the series: Packaging & Deployment in Visual Studio

By Martin Hatch, Associate Principal SharePoint Consultant
www.martinhatch.com

About the Author

Our technical team contribute with blogs from their respective specialities, be that Azure, SQL, BizTalk, SharePoint, Xamarin and more. From the lead architect to developers and testers, each person provides content straight from their experience.

Back To Top
Contact us for a chat