SharePoint XSLT Template / Boilerplate

XSLT is pretty cool once you learn how it works. Honestly though, I never had any desire to really play with it though until SharePoint Designer removed the design view functionality. Once that disappeared, I decided all those years (a decade plus) of only mingling with XSLT was going to need to get very serious if I wanted to keep up my relationship with SharePoint 2013.

Thankfully, I have enough knowledge around development so decided I would just take on XSLT head on! Well, I quickly realized I would need to start small if I wanted to mess with any XSLT view that SharePoint spits out. So with that, I give you the XSLT boilerplate template for SharePoint.

Download Now!

SharePoint XSLT Boilerplate 1.32 KB 633 downloads

Use the attached XSLT template as a boilerplate style to your SharePoint web part, ...

How to Implement SharePoint XSLT Boilerplate / Template

Well, there are a ton of different ways to utilize an XSLT template in SharePoint, so I’m going to assume that you also have a basic understanding of programming to not only implement, but also modify the template to your liking. After all, you wouldn’t have stumbled across this article if you didn’t have some understanding…right?

The basics to the below should be enough to get you started. First, you paste the entire template between the <XSL></XSL> sections in your web part. Within the template you will see the two sections below. This is for your basic, plain-jane HTML table. The first section is the container for template, and the highlighted rows are where the second section is called, which is the repeating section (rows) for the table.

This template will generate a repeating table of your data based on what columns you call. This example calls the ‘title’ column and the ‘description’ columns from your SharePoint list.

So that does it! Hopefully now you will be on your way to styling up some sexy web parts in SharePoint. As always, feel free to drop a comment below if you have any questions or need assistance.