In this post all the search display template custom document properties of are explained.
Here is an example of how an out-of-the-box display template document property section looks like:
|
|
Content Type IDs
The following values can be specified for the ContentTypeId property:
**Display Template** | **ID** |
Control Display Template | 0x0101002039C03B61C64EC4A04F5361F385106601 |
Group Display Template | 0x0101002039C03B61C64EC4A04F5361F385106602 |
Item Display Template | 0x0101002039C03B61C64EC4A04F5361F385106603 |
Filter Display Template | 0x0101002039C03B61C64EC4A04F5361F385106604 |
|
|
Target Control Type
This property TargetControlType specifies which web parts can use the display template.
**Web Part** | **Property Value** |
Content Search Web Part | Content Web Parts |
Search Result Web Part | SearchResults |
Search Hover Panel (used in the in combination with the item template) | SearchHoverPanel |
Searchbox | SearchBox |
Refinement Web Part | Refinement |
Taxonomy Refinement Web Part | TaxonomyRefinement |
|
|
Master Page Description
As the name suggests, the MasterPageDescription property defines the description you want to give to the display template.
|
|
Template Hidden
The TemplateHidden property specifies if the template is hidden for people to select it in one of the search web parts. Values can either be 0 (visible) or 1 (hidden).
|
|
Managed Property Mapping (Item Display Template)
The ManagedPropertyMapping property needs to be used to determine which managed properties needs to be retrieved to make use of them in the item display template. The format in which these should be provided is: “slot name”{display name in web part properties}:“managed property name”.
Note: the display name isn’t required, you could also specify it as: “slot name”:“managed property name”.
|
|
You could also specify multiple values for a specific slot. That way, if the first property doesn’t contain a value, it takes the next one.
|
|
Compatible Search Data Types (Filter Display Template)
The CompatibleSearchDataTypes property can only be used in the filter display template. It specifies for which types of search data types the template can be used.
The following values can be used:
- Text
- Integer
- Decimal
- DateTime
- YesNo
|
|
Note: more information about this property can be found here: Create Your First Search Refiner Control Template.
Compatible Managed Properties (Filter Display Template - Optional)
With the CompatibleManagedProperties property you can specify the managed property names you would like to use the filter display template with.
The values in this property should be separated with commas.
|
|
Note: at the moment I haven’t used this property. During the first tests, I didn’t notice any difference by applying this property. If you check the JavaScript version of the display template, you’ll see that the CompatibleManagedProperties property is added, but it’s never used.
Html Design Associated
This HtmlDesignAssociated property describes if there is a JavaScript version of the display template associated to the HTML version.
|
|
Preview URL (will automatically be defined by SharePoint)
The HtmlDesignStatusAndPreview will automatically be defined by SharePoint from the moment you create the HTML display template. This property gives a link to the HTML version of the display template and a status description. If there is a problem, it will say Warnings and Errors. Otherwise you’ll get Conversion successful.
Design Conversion Succeeded (will automatically be defined by SharePoint)
The HtmlDesignConversionSucceeded is linked to the previous property. If the display template conversion is successful the following property and value gets added to the display template:
|
|