Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
13 views

Include external script in display template

I'm creating a custom search result display template. I'd like to reference an EXTERNAL javasacript. The only examples I've seen copy the JS file into a library on the server and reference it from ...
0
votes
1answer
12 views

SP Online - custom Display Template - square boxes instead of font icons from Office UI Fabric icon set displayed in checked-in state

I encountered a problem, that it displays only empty square boxes instead of nice (custom font) images from generated Office UI Fabric icons set, since I change the state of the with the web-part to ...
0
votes
0answers
10 views

Strange error in Display Template after removing other web part

I'm facing a strange error when a user edits a web part page. There are a couple of web parts on this page, like content editor, a search content web part (for displaying some user information from ...
1
vote
1answer
12 views

Creating custom display template with search result web part

I am required to create a display template programatically which is via visual studio and I am really new to this. Can anyone share with me a sample source code for creating display templates and how ...
0
votes
0answers
12 views

Custom Item Display templates not generating js file or showing up in web part

I've been working on a custom item display template for a CSWP. I made a copy of Item_TwoLines and renamed the file and tags during editing in NotePad++, then saved the HTML back to ~/_catalogs/...
0
votes
1answer
22 views

Display Template: extract Item Summary

Creating a custom display template for search we're facing this request: the search result item should show first the item hyperlink, then some managed properties and finally the item summary. In the ...
0
votes
1answer
10 views

Where are the css files used in search results stored in SP Online?

I'm customizing a search display template. There is an is a nice transparent overlay on a photo where I display text, but my text is no longer fitting in the overlay because I've added an additional ...
0
votes
1answer
11 views

How does property mappings work in Content Search Web Part

I am using the Content Search Web Part to display some drone photos. In the shot below, it is showing each building with the File Name and the date/time of the photograph beneath it. I would like to ...
0
votes
0answers
13 views

Search Display Templates not appearing

I'm using SharePoint Online. My root site collection has search display templates appearing correctly. I see the js and html files. I've created another Site Collection, and all I'm seeing are js ...
0
votes
1answer
11 views

Using 'replace' for URLs in Search Results display template?

I am building a work-around for an issue I've encountered with a product catalog. For some reason, the CSWP and Search Results web part are displaying spaces in the managed metadata term at the end of ...
0
votes
0answers
16 views

Documentation for display templates functions and variables

I am reading few blog posts, that use functions and variables like this: $htmlEncode ctx.ClientControl.get_nextUniqueId() var hiddenElmId = $htmlEncode(ctx.ClientControl.get_nextUniqueId() + "...
0
votes
0answers
8 views

Display Template vs WebPart

I am trying to understand the best practices around whether to use Display Templates or a Custom Web Part to display contents of a list on a Web Part Page. As an out an out developer I would err on ...
0
votes
1answer
28 views

Can jQuery Datatables in a search results web part return more than 50 documents?

I've hit a wall on figuring out how to remedy this issue. Im currently developing a search center page with jQuery datatables and control and item display templates. The search results webpart is ...
0
votes
0answers
14 views

Where are the CSS files that control how search result items are displayed stored?

I'm using a customer Display Template for PDF documents. The Title of the Document is being truncated (with ...) I've gone it Developer tools and it appears that the title display is controlled by ms-...
0
votes
1answer
34 views

Color Code Due Date in Display Template to Red

I have a great display template that is working almost as expected. I now have a request to have the Due Date show RED once it is past due. I am still learning how to change things in the display ...
0
votes
0answers
17 views

Limit to how many Mapped Managed Properties you can have?

I am working in a display template and it is only showing 10 of the 11 property mappings in the web part. I need to know how I can add the 11th property. I have already updated the field in the ...
0
votes
1answer
88 views

Display Template Date Format not working to display mm/dd/yy Please Help!

I have a display template that is working, however it is not displaying the date in the format that I want. I need it in the following format MM/DD/YY I had someone trying to help but they bailed on ...
0
votes
1answer
59 views

Display Template format Start and Due Date MM/DD/YYY

I have a display template that is working awesome but for the formatting of the Managed Property not displaying the date correctly. I do not want the time included in the display. I am still ...
1
vote
2answers
60 views

Making users display name searchable in display template

I have a search display template showing some documents based on a content type and one of the fields DocOwner, which is a people field. Using javascript it is simple enough to get the user's display ...
0
votes
1answer
20 views

Search - How to change default boolean operator from AND to OR

I believe this is controlled by the Search Box Display template, but I'm not 100% sure. Does anyone know? Thanks!
1
vote
0answers
15 views

Modify the Search Navigation display template

Can we modify the search navigation web part display template? I wish to add a bottom border to the selected page navigation header.
2
votes
1answer
41 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
1answer
33 views

Search display template for content search web part for task aggregation

In a site collection, I have about 4 task list setup each on separate subsites. So on the root level, I am using a content search web part and through query, I am showing tasks from all of these 4 ...
0
votes
1answer
144 views

Custom refiner display template: Possible to change refiners' display names?

Does anyone know if it's possible to create a custom refiner display template that renders the refiner values differently to their native values? I have a managed property Manager act as a refiner: ...
1
vote
0answers
27 views

Apply custom Item Template to Promoted Results

We have hybrid search enabled in our SharePoint search environment where-in we are displaying federated search results from SharePoint Online tenant in our on-premise Search site. We display few top ...
0
votes
0answers
73 views

SharePoint 2013: Group Search Results by Site Name

I have added a Search box and a Search Results web part with the query which retrieves documents from different subsites. Now, what I want is to group this documents by using Site Name and show the ...
0
votes
1answer
51 views

SharePoint Display Templates doesn`t work with hyphen

As it seems hypens in Managed Properties are still an issue in SharePoint 2016 / 2013. I had an issue with an existing business application and did some tests to find out more. I created two managed ...
2
votes
1answer
54 views

How to change Search Display Template for Person Result Type

I am trying to add a link to the Hover Panel of the People Item Display Template. I've can't change the Display Template for the Person Result Type. It seems you can't edit Result Types provided by ...
1
vote
1answer
24 views

SharePoint Hybrid Search - Find published News in SPO

SharePoint Online provides publishing "SharePoint News" in modern sites. If you use SharePoint Hybrid Search you can find content from SPO on premise and vise versa. I would like to provide a ...
1
vote
0answers
49 views

output my search results filters after the initial render SharePoint 2013 / O365

I'm trying to write a custom filter display template. My template requires some external calls, and thus requires some async work. How can I output my filters after the initial render? I have to read ...
0
votes
1answer
56 views

Filter on the basis of Site Title (O365)

I am showing data from 30+ different SharePoint sites. In the search results page i want to filter the result on the basis of Site Name or Site Title. However in O365 we do not have option filter on ...
0
votes
1answer
124 views

Lost preview in hover panel after applying custom display template

Similar to this question: Custom Display Template, on one content type, lost preview on word files, powerpoint, etc, I have created one content source where multiple content type data will be fetched. ...
1
vote
0answers
82 views

SharePoint 2013 Retrieve URL from Publishing Hyperlink column in Display Template

Working on a site in SP2013, I have created a custom display template to display a series of items. The problem is when I reference the publishing hyperlink field in the html as the src value of my a ...
0
votes
1answer
139 views

Sharepoint 2013 Display publishing image using content search webpart with custom display template

I am working on a site in SP 2013 and want to display a series of items each with an image from a publishing image field in the item. I have created a custom display template but am having issues ...
1
vote
1answer
46 views

Custom display template for videos working for 1 of 4 videos

I've customized the Item-Video display template to surface data from some custom columns. It's working perfectly on 1 of the videos, but not the other 3 that I uploaded. They are all MP4's in the ...
0
votes
1answer
53 views

How to customize Display Template Hover Panel Header

I'm trying to customize the Header portion of my hover panel. The header is called in the Default Hover Panel like so: <div id="_#= $htmlEncode(id + HP.ids.header) =#_" class="ms-srch-hover-...
0
votes
1answer
300 views

Changes to Display Template not appearing

I have customized the Item_PDF Display template. I would like the hover panel that is displayed to be based on the Item_Person_Hover panel. The goal is to present expertise information about the ...
2
votes
1answer
124 views

Search Display Templates - How to display hover panel on click rather than on hover

I'd like to customize my Display Template so that the Hover Panel appears only when a user clicks on an item in the search result. The default behavior is the hover panel appears when a user mouse's ...
1
vote
1answer
76 views

Running custom function before SharePoint renders page

Some Background I have a publishing site that presents documents with stylized icons using some custom display templates and views (with CSR). Document icons are rendered using fontAwesome classes ...
2
votes
1answer
290 views

PDF Files not opening when clicked from the content search web part

I wrote a custom display template for a content search web part that shows recent documents edited or modified by a user. I added hover functionality as well to allow users to hover. For some reason ...
0
votes
1answer
59 views

Random seed in search result webpart query

I am looking for a way to randomize a result table. I used to do this via REST-API like this var randomSeed = parseInt((Math.random() * 1000000), 10), searchUrl = _spPageContextInfo....
0
votes
1answer
235 views

How to deploy display templates with pnp?

On SP 2016 on-prem I am trying to write a console application to upload files, mainly display templates. I create a dummy site collection, and upload display template in "_catalogs/display templates/...
1
vote
1answer
48 views

“Converting” project from old to new technology?

I am working on a SharePoint project which started a couple of years ago. It started with SP 2013 on - prem, and we are now on SP 2016 with feature pack 2. In the project we used the Powershell based ...
0
votes
0answers
17 views

Is it possible to have multiple hover panels in the same display template?

I would like to know how to create multiple hover panels in SharePoint online search display templates. I am using this but it does not seem to make any difference: var id = ctx.ClientControl....
1
vote
0answers
33 views

How to modify the url in the search results?

I am using sp 2013 on prem. I created a new page and used the search result pagelayout. On this page you have the OOTB refiner, search box, search resultscript webparts. I would like to clone some ...
0
votes
0answers
52 views

Corrupted control template, but control does not exist on ascx

Corrupted control template. Please check RenderingTemplate of "TextField" in the control template ascx file I was receiving above error while working on custom column type, for debug purpose i ...
0
votes
3answers
549 views

Managed property not showing in Display template

We have a BCS-model which gets data from a database outside of SharePoint. We make data from the BCS searchable by creating managed properties and then mapping them to the auto generated crawled ...
3
votes
1answer
394 views

display List/library url in display template

I am trying to add the url of libraries in the display template. ListUrl does not return any value. So I thought using javascript to replace the filename to "". However it is throwing an error: ...
0
votes
1answer
37 views

How to encapsulate a .mht file in sharepoint online

I have some .mht files and I want to display in a sharepoint page. I'have tried the "content editor" but seems like in only work with HTML files. There is some solutions ?
0
votes
1answer
89 views

Increasing the page numbers of paging in SharePoint search

I am looking for some help on search display template. I need to change the code in Control_SearchResults.html file to increase the no of page numbers. Can someone please help me to get this. On ...