Questions tagged [display-template]

Display templates in SharePoint Server 2013 are templates used in Web Parts that use search technology to show the results of a query made to the search index. Display templates control which managed properties are shown in the search results, and how they appear in the Web Part. Each display template is made of two files: an HTML version of the display template that you can edit in your HTML editor, and a .js file that SharePoint uses.

Filter by
Sorted by
Tagged with
1
vote
1answer
4k views

SharePoint 2013 - Display templates - media queries to get image rendition on images based on screen size

I know I could use device channels to do this, but is there a way to get right image rendition with media queries? item display template <div class="image"> <style> @media only ...
5
votes
2answers
6k views

Run javascript after display template loaded

How can I run some JavaScript after my display template has loaded. I have tried: AddPostRenderCallback(ctx, function () { jQuery(document).ready(function () { alert(jQuery('.ms-srch-...
0
votes
1answer
1k views

'Search on Yammer' link in search center refiners

I have a heavily branded site I'm working on and can't find where the "Search on Yammer" link is being populated from. It appears within the search refiner/filter web part in the left column but none ...
3
votes
3answers
6k views

How to get the list name on a content search webpart displaytemplate

I used the display template from Elio Struyf to create a datatable "format" with my results. http://www.eliostruyf.com/table-layout-display-template-with-managed-property-sorting/ However its my ...
0
votes
2answers
1k views

How to show default picture in display template if no picture found on the item?

I have cloned the OOTB displaytemplate "Item_PictureOnTop.html". I would like to show a default picture if the picture not found on the item. Is that possible with custom css? example here of current ...
4
votes
2answers
6k views

Display Template HTML file missing in SharePoint online

I'm trying to learn how to manipulate display templates on SharePoint. I have a SharePoint online account but I can only see the .js files and not the HTML files we're suppose to work with. Is this ...
3
votes
2answers
5k views

How to pass parameters to the Control display template of a Content Search web part?

Using SharePoint 2013 I have a Content Search web part that I'm using to display 5 News Articles using the following display templates: Control: List Item: Picture on Left, 3 lines on right And this ...
3
votes
1answer
3k views

Custom Display Template, on one content type, lost preview on word files, powerpoint, etc

I created one result type like this: I copy paste Item_Default.html to Item_BillCycle.html and modified a few lines: <mso:ManagedPropertyMapping msdt:dt="string">'Title':'Title','Path':'...
2
votes
1answer
331 views

SharePoint 2016 Managed Property not returning values in Search Hover panel

I have a Site Column "Doc Description" multiple line of text, added that in both list and library .Then Added few records in list&library published,created managed properties did full crawl and ...
1
vote
2answers
2k views

AddPostRenderCallback in ItemTemplate is not getting called in Sharepoint Online

Hi I have an item template. In which below is the code for the AddPostRenderCallback. AddPostRenderCallback(context, function () { alert("Inside Addpostrendercallback"); ...
0
votes
1answer
2k views

Rich Text Column content in Display template for Search Results webpart

I am trying to display content from a rich text column (ArticleContent) in my search results webpart using a custom display template. <div id="_#= $htmlEncode(itemId) =#_" name="Item" data-...
0
votes
1answer
599 views

How sharepoint Search chose which fields to be shown inside the default display template for the list items

I am working on a sharepoint server 2013. and i have a list which contain the following built-in fields:- Title Description and so on.... now when i search for list items i always get this display ...
0
votes
1answer
1k views

Get site title and display it search results

I am using display templates to search specific items based on content type and display them in the root site. One of the requirements is to display the site title besides the item. Searching on the ...