Preaching SharePoint

What are “Display templates” in SharePoint 2013

SharePoint 2013 has a lot of new features and we are constantly writing about them. So here we are with a new feature  “Display templates” that will help you style the SharePoint Content with the way you want.
What are Display Templates? – To eliminate the fact that the designers and power users needed to modify the XSLT each time they needed a particular look and feel  In SharePoint a new concept of Design Templates has been introduced.Each Display Template consist of two files -
1. An HTML file (.html)
2. JavaScript File (.js)
The actual display pattern will be in .html files. The .js files are generated automatically when you upload an .html file.
Where can I find the Display Templates? -  SharePoint 2013 gives you various Out-of-Box Display templates located in Master Page gallery.
Navigate to Site Settings -> Master pages (under Web Designer Galleries)
How do Create a New Display Template ?
You would typically copy an Existing template and rename it to a new one. Since HTML is where you create the actual HTML for your display template you can simply open this in any editor such as Dreamweaver.
Benefits of Display Templates ?
* These are Re-usable Styles Files for your Content based and Search Results WebParts.
* You can add Inline JavaScript in your display Template.
(Side note – You need to add JavaScript in First DIV tag in your display template. Also, it needs to go between an opening and closing tag set that looks like this: <!–#_ and _#–>.)
* You can add Managed properties in the Display Templates.
* You can Invoke JQuery Plugins or Javascript functions on the data  using OnPostRender() function in the Template.


0 Respones to "What are “Display templates” in SharePoint 2013"

Post a Comment


Do you want SharePoint 2013 to inherit Metro Style design?

Search This Blog

Return to top of page Copyright © 2010 | Platinum Theme Converted into Blogger Template by HackTutors