If you've never heard of, it is quite normal, as it is new in SharePoint 2013. These Display Templates can dynamically change the display of search results, making them particularly match "Result Types".
You can access to Display Templates via:
I will detail here this second link.
Click on the "Display Templates" folder:
I choose here to open the "Search" folder:
You will find the Display Templates, each being defined by:
File names are relatively speaking, above we can deduce that the Display template controls the display of Word documents "Hover Panel".
We will change this "Hover Panel" later in this article:
The "Display Templates" are closely related to another SharePoint 2013 new functionality: the "Result Types". In summary, a "Result Type" it is a set of rules that are used when displaying search results.
When you run a search, and when the results are displayed on the results page, each result is verified to see if it meets one of the rules: If this is the case, the "Display Template" associated with this rule (this "Result Type") is used to display the
For example, you can define a rule (a Result Type) that combines a display (a Display Template) especially for Word documents containing "SharePoint" in their title - This is the example that will be used later in this article.
In this example, the scenario is that you need to display a customized "Hover Panel" for any Word document containing "SharePoint" in its title.
To do this, I will:
The steps are as follows:
1. Download the "Item_Word_HoverPanel.html” file
2. Modify it and upload it again in the gallery as "Item_Word_HoverPanel_SPAsipe.html"
3. Fill the properties (note the ‘Target Control Type" parameter)
4. Similarly, download "Item_Word.html" and rename it "Item_Word_SPAsipe.html".
Open the file with an extremely powerful tool (Notepad for example) and change the link to the customized "Hover Panel" (note that this is the. Js file that is referenced, not the html one).
5. Upload this file in the gallery, and note that the Js files associated with the html files have been generated during the upload.
6. If you start the Design Manager, "Edit Display Templates" link, you see that the two html files are marked as having been converted.
7. It is now time to create a Result Type for our needs.
Go to the Site Settings, click on “Result Types”.
8. The list of existing Result Types appears, click on "New Result Type"
9. Conditions must be defined: here we want the items using our new "Hover Panel" to be Word documents having "SharePoint" in their title.
10. It only remains to associate this condition with our template
11. The Result Type is created
1. The document chosen for the test has "SharePoint" in its title, and you can see that the customized Hover Panel that displays
2. If I choose an another Word document, the default “Hover Panel" displays
The Display Templates are configurable (among other places) in the "Search Results" webpart properties:
By default the rules (Result Types) are used, but you can change this behavior.
Beyond this example a bit trivial, these features allow much opportunities, especially for future "search-driven" applications. Personally, I find this feature very interesting.
This article is part of a series of articles dedicated to the Design Manager in SharePoint 2013. They are actually written in French and hosted on my blog, but I will translate and transfer them on the TechNet Wiki.