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
2
votes
1answer
133 views

How to handle & and + characters in hyperlinks in the search People hover panel template

In our SP Server 2013 environment we have an employee directory. The hover panel that shows up next to a result shows the Department name of an employee. This is a clickable hyperlink. When a user ...
1
vote
1answer
2k views

Sharepoint 2013 : Increase width and number of characters in search refiner web part

Is there any way to increase the width and number of characters in search refiner web part in SharePoint 2013? I remember there was this option in SharePoint 2010. I know we can tweak CSS and ...
1
vote
1answer
139 views

Hide link to document library in Search SharePoint 2013

I have requirement from customer where they want to hide the link to document library. Marked yellow in the following picture: Is it possible to do it? If yes, how?
0
votes
1answer
297 views

Item_CommonHoverPanel_Actions display template: Click event doesnt fire second time

I have added a custom action "Test Link" to item_CommonHoverPanel_Actions display template as shown in figure below: Every thing works fine if i hover over Test 1 and Click on "Test link". But if i ...
2
votes
2answers
2k views

How to check if picture exists in item display template?

I tried to check in my custom item display template if a picture exists by url. Sometimes the site Logo is set to some path of an picture, but the picture doesn't exist anymore. I would like to ...
2
votes
0answers
28 views

Showing joined list connections in search results hover

I have searched for this but haven't found any examples (maybe it's my searching abilities) but I am hoping to solve the following problem in SharePoint 2013. I am trying to replace a document ...
2
votes
3answers
4k views

How do I format a Date for my local region in a customised SharePoint Display Template

How do I format a date in a customised search Display Template to show the date in my Region rather than UTC. I use the following XSL in Content Query Web Parts to present the date in my timezone, ...
2
votes
1answer
405 views

Customizing item_CommonHoverPanel_Actions display template

I customized the item_CommonHoverPanel_Actions display template and added custom link to it. Whenever user clicks on the link he/she is redirected to another page. What i am trying to do now is to ...
3
votes
1answer
1k views

getItemValue() getting the value twice?

I'm working on a Content Search WebPart which displays a list of pages. The third line, in my properties, returns a PublishingPageContentOWSHTML. But is it normal that its value appears twice, once ...
0
votes
2answers
3k views

How to remove the seconds part from a date and time property

We have a standard Calendar app in SP2013 with some events that we roll up on a homepage using a content search web part (the Two Lines display template). We show two properties: the title and the ...
1
vote
2answers
759 views

How to get logged in username in custom display template for CSWP using CSR

I am using a custom display template for Content search web part. I am able to get currentItem's properties but how to get logged in user's username using client slide rendering.
1
vote
2answers
288 views

How to control the order of my javascript logic in my display template?

I have created a custom item display template. In this custom item display template I try to check if the current user has contribute permissions to the item. The item is an sitecollection. If the ...
1
vote
2answers
943 views

Check clientside if current user has contribute permissions on current site?

I would like to check in the item displaytemplate if the current user has contribute permissions on the current item. The current item is an site object because in my search query I use contentclass:"...
3
votes
2answers
5k views

How to add mobile phone number to people search results?

I'm trying to add some more information to the peopleresults.aspx. I tried to follow the instructions here but I get an undefined error for the has_mPhone variable. Is there something wrong is ...
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 ...
1
vote
2answers
701 views

Why is my custom display template not selected in my provisioned page?

I created custom display templates (control and item). I provision also a new page. This page is using my custom pagelayout with some webpart zones. I add some webparts inside this webpartzones by the ...
2
votes
1answer
1k views

How to deal with asynchronicity in display templates

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've ...
5
votes
1answer
364 views

Display templates written in html alter for loops

In a display template (a filter item template to be precise), I observe a weird behavior with for loops. Let's say my template consists in: <div id="CustomRefinement"> <!--#_ for(var x=...
1
vote
1answer
586 views

Can't display a Refinable String in my Item Template

I have created an item template, which is a copy of the 'Word Item' template. Within the libraries I'm searching against, I have a Yes/No field called 'privatedoc' which I have mapped to the '...
0
votes
2answers
1k views

Custom properties not shown in search results, but in profiles shown

Im connect custom attributes in profile service AD item (homePhone, CellPhone), after sync they are shown in profiles (private sites). Then Im add this properties in display templates of search ...
3
votes
1answer
97 views

After changing display template of search results - search isn't working

I'm changing a display template (copy Item_Person, modify, and add Item_Person_WorkPhone) and adding a new search type. It works, but only with my administrator account. Users with Read permission ...
0
votes
2answers
292 views

Why can I not publish an item display template?

I have built an item display template which I have added to the contents web part folder in the masterpage gallery. I need to publish this template - When I try to select the item (or any other item ...
0
votes
1answer
2k views

Customize People display template on Everything scope (results.aspx)

I've successfully created a new People display template (Item_Person.html) and associated result type, and used it on the peopleresults.aspx page. Now, I'm trying to achieve the same effect on the ...
0
votes
1answer
576 views

Search result web part - item display template - How to retrieve images from article

I'm trying to show results with a simple display template. But I get a error: Cannot read property 'getPictureMarkup' of undefined How do I retrieve images with search result? I was hoping that I ...
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 ...
1
vote
3answers
922 views

How to display site's title in search results

Using display templates, how can I display the site title next to item(s)? I don't see there is a OOTB managed property.
1
vote
0answers
2k views

How to make Content Search Web part look like OOTB list

I am trying to query a few lists in subsites and I have been asked to display them or have a look and feel of OOTB Lists. with the capability to filter, sort. How can I do that? is it easy to build ...
0
votes
1answer
4k views

display HTML styling to a div using content templates and JS

I am busy working on creating a 'new and announcements' web part for a client using a 'News' list, a content search on a New content type, and displaying it using a display template and javascript. ...
1
vote
2answers
2k views

SharePoint 2013 Modal Dialog in Display Template

I am working on a custom action in the item_commonhoverpanel_actions display template that links to the item properties (dispform.aspx) of the item. So far it's working, however I would like to show ...
1
vote
1answer
2k views

Control Display Template

I created an Item display template and a result type for this template, I can see the Result type when I try to change the webpart properties for a search results webpart but.... for the Control, I ...
3
votes
1answer
2k views

Display templates - HTML and conditional formatting

I'm working with a custom hover display template where I am trying to display an optional description (multiple lines of text) column with 2 additional breaklines (<br>) to give the text some ...
1
vote
1answer
608 views

Render a users Lync status in a display template

I'm trying to render the author field in a custom display template to show the Lync presence icon. I would like to get a result similar to this template that displays the presence and the name. But ...
1
vote
0answers
351 views

SharePoint 2013 Search Center - Alternative for $includeLanguageScript?

Is there an alternative approach to loading the language resource files with $includeLanguageScript in SharePoint 2013 Search Center? Sometimes it happens that the file is not loaded fast enough, ...
0
votes
1answer
108 views

Get the same display templates for CSWP as for search results

Is there any easy way to use Content Search Web Parts but to be able to use the exact same display template as already defined for search results? I tried copying the .aspx files (control and list) ...
8
votes
2answers
15k views

Custom calendar display template / JS Link

I'm looking for a nice custom calendar. Display template or jslink, doesn't matter. Something like that would be awesome: http://deviprsd21.github.io/Calendario/index2.html Has someone tried to add ...
0
votes
1answer
20 views

Custom property for people profiles

I have added 1 new property to people profile named "DepartementTest" and filled it out foreach user. I have added my new property to my custom display template. I have built a people-dictonary and ...
1
vote
0answers
87 views

Item template doesn't include ListItemID?

I have a content search webpart and am using a modified version of the default Item-Picture3Lines.html template. The custom parts are to add our own "like" button. <div class="like-icon" data-item-...
0
votes
1answer
357 views

Unneeded display template js files loading

I have several search results web parts on my page that all use custom display templates. Upon doing some performance testing I'm seeing several js files being loaded that aren't needed and I'd like ...
1
vote
0answers
160 views

Search Result Block with Custom Managed Properties

I have a query rule that triggers the display of a result block. I have a couple custom managed properties I'd like to display in the result block, but they always show up empty in my display template....
0
votes
0answers
144 views

Display template conditional format

I've been working on a display template to format a timeline. Right now I'm working on conditional formatting to show icons for each content type shown in the timeline. The conditional works fine as ...
0
votes
1answer
481 views

Display template get rid of the height and width when asking for picture URL

I'm having a display template (item) that gets a picture URL. ex: var pictureURL = $getItemValue(ctx, "Picture URL"); picture URL is then www.awesome.com/picture.jpg?width=100&height=100 ...
2
votes
3answers
1k views

Make Search Results open in new tab

Ive implemented a SharePoint 2013 Farm Wide search for my site collections, and now want the URL's that get returned to open up in a new tab. Is there a relatively effortless way to do this rather ...
0
votes
1answer
2k views

JSLink conflict with lists of the same type (List Custom 100)

Problem I've two custom lists with ListTemplateType = 100. When I insert both into a page, the last rewrite the first. I tryed add BaseViewID with diferent ID, like this question. But anything ...
0
votes
2answers
527 views

Modify the foot of Item HoverPanel in Search results SharePoint 2013

I want to add 4 buttons to the bottom of display template Item Default HoverPanel for search results. I need it display like the person column with user's name and photo. By default, it displays Open ...
2
votes
1answer
711 views

Display a person column in search result webpart SharePoint 2013

I want to add a person column with person's name and image in search result webpart. I create a item display template and add this property "Team Member" to this custom template. But the results ...
1
vote
0answers
396 views

SharePoint Foundation Display Template - managed metadata missing

I'm trying to customize the display of search results in a SharePoint Foundation 2013 environment. Since this environment doesn't have the publishing feature, I'm creating the HTML display template ...
1
vote
0answers
94 views

Displaying list items in my site

I have a need to display content from a list in another site collection on every users My Site page - About Me (/person.aspx). The list is essentially responsibilities for users. So the list needs ...
1
vote
0answers
428 views

Adding javascript after click event of the refiners (display template question)

I want to execute my javascript code postrender of my refiners. I have done that by using this: ctx.OnPostRender = []; ctx.OnPostRender.push(ctx, function () { mycode(); }); This all ...
2
votes
2answers
2k views

This item cannot be deleted because it is still referenced by other pages. SharePoint 2013 Display Template

I am trying to delete a display template's html file. I tried PowerShell script, tried doing it manually, and also tried SP Designer to delete. But with all I am getting same error. Error: this ...
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-...

1
4
5
6 7 8