#SPSBE33
Agenda
• The Past & Present
• What are Display Templates?
• Where are they used?
• What to do before you can start
• Creating Display Templates
#SPSBE33
What it does
• Retrieves managed metadata
• Displays via HTML and
JavaScriptFile extension Title + Path
Path
Document summary
#SPSBE33
Control Template
Provides the overall layout how
you want to present the results.
Ex: list, list with paging, slideshow.
Item Template
Defines how the item itself
needs to be rendered.
Web Part
Specifies which query and
templates will be used.
Logical Structure – Content Search WP
#SPSBE33
What to do
before you
can start
1. Create content
2. Crawl content
3. Define managed properties / or
use the auto-created ones
4. Crawl content again
#SPSBE33
Creating a
display
template
• Map the master page gallery
• /_catalogs/masterpage/Display
Templates/
• Use one of the existing templates
• Use an editor of your choice
4/29/2013 22
#SPSBE33
Event
Handling –
Recap
Use OnPostRender to ensure that
control and item HTML content is
loadedctx.OnPostRender = [];
ctx.OnPostRender.push(function () {
// Write here your JavaScript code
});
Template may not be modified Twitter hashtag: #spsbe for all sessions
Client-side rendering is what you wantBy default the Content Search Web Part uses client-side rendering. Using JavaScript-based Display Templates it allows you to build rich and dynamic experiences. With nothing more than the standard capabilities provided with SharePoint 2013 you can easily turn static content aggregations into interactive overviews that can be filtered using refiners to help users find the content that they are looking for.Another benefit of using client-side rendering is less performance impact on the server. Because the rendering happens in the browser, SharePoint can now spend less time on building up pages and have them served faster what leads to increased perceived performance.Despite all those benefits there are still scenarios when you might need to use server-side rendering instead.