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
0
votes
2answers
156 views

Infopaht form: once repeating table is created, how can i add display rows to be default?

I created the repeating table with two rows display initially, but i would like to have 5 rows instead. How can I fix it?
0
votes
0answers
693 views

How to load script from hive in display templates

I'm trying to load a script from the hive in my display template. I've tried <script src="/_layouts/15/1033/comany/js/bootstrap.min.js" type="text/javascript"></script> and <...
0
votes
1answer
929 views

Using Terms in Search Result Display Template

I'm writing a custom Result Type Display Template and I would like to display an item's term set in a <ul> list. The ctx.CurrentItem contains the managed property { 'terms': "GP0|#88e40baa-...
1
vote
2answers
5k views

creating custom functions in display template

<a title="_#= $htmlEncode(Srch.Res.sb_GoSearch) =#_" class="ms-srch-sb-searchLink" id="_#= $htmlEncode(searchBoxLinkId) =#_" onclick="CustomFunction();" href="javascript: {}"> ...
1
vote
1answer
1k views

Content Search Webpart not getting Picture URL

I've built a DisplayTemplate (ItemTemplate) for a ContentSearchWebPart. It works quite well for different fields, but I don't get my PublishingImage from the pages I'm querying. The ...
0
votes
1answer
398 views

How to edit a Display Template directly with Visual Studio

I'm working on a Display Template for the standard search Refinement web part. The problem is that every time that I need to change it (with Visual Studio 2013) I have to pass from a manual delete ...
0
votes
1answer
2k views

Problem with adding a custom managed property in the People Search Hover Panel

We are using O365/Sharepoint Online 2013 (+ Sharepoint Designer 2013). We are using people search center as our intranet "Phone book" and it's working really well and I managed to customize the ...
2
votes
0answers
1k views

Custom Search display template: In some items I see the field "HomePhone", in others not, but it is filled in UPS

I am using SP2013 standard. I have a page with a search result webpart which shows all people. I cloned the person-item displaytemplate. I added some extra fields to it. But on some results I see the ...
4
votes
3answers
740 views

Is there a way to display a warning message inside my enterprise wiki page layout , when the page status is Rejected

I am working on a publishing site collection using the Enterprise wiki template. Currently I got this behavior regarding the versioning setting. For the library I specify that the library content ...
3
votes
1answer
1k views

How can you share script members between control template and item template

I'm developing two custom display templates (Control and Item template) and I'm wondering if it is possible to share script members between these two templates, e.g. if I add something like var bar = '...
5
votes
2answers
769 views

Managed properties missing in the search results webpart when not using the querystring

When using the search results webpart without the querystring (For instance when trying to use managed metadata navigation) I am unable to view custom managed properties AND am unable to see any ...
1
vote
1answer
1k views

Refinement Token for starts-with or prefix search

I am trying to create a custom refiner based on the path managed property. After selecting it should show items in a directory so I have to use a prefix search with the property path. var refiner = {...
4
votes
1answer
2k views

SharePoint 2013 CSWP Refresh

I have a situation where I need to display announcements based on year and month. On the page I have a dropdown essentially for Year and Month which will drive the Content Search Web Part. Using query ...
0
votes
1answer
2k views

Sharepoint 2013 display templates look different to users

As admin user everything looks fine on the site, but when I log on as a normal user the display templates gets another look. Some of the display templates also get an error "Sorry, something went ...
3
votes
1answer
1k views

List Enterprise Keywords in a Content Search WebPart Display Template

I am having problems preparing my own display template for the Content By Search WebPart running queries on a wiki page library - so far I have been successfull in displaying the title, author and the ...
1
vote
1answer
692 views

Search Results Clear On Refinement or Subsequent Search wiith Custom Display Template

I'm working with a custom search display template. I have my results shown as a grid as well as a few other changes. Since it is shown as a grid, I have a requirement to show the rows with ...
2
votes
1answer
2k views

SP2013/Display templates: Get index of current display template item?

I am using SharePoint 2013 and building display templates. I have now a control and item display template. In the control display template I can get the index of each item: inCtx.CurrentItemIdx But ...
2
votes
4answers
4k views

What is the best practice to clone the default search result display template?

I am using SharePoint 2013. I have created a new search page. On this page you see the search result webpart and the refiner webpart etc. I have selected the search result page layout. Now I have ...
0
votes
0answers
340 views

special character displayed not well in display templates

I have built some display templates which are showing some content. I see sometimes that the special characters are not showed very well. See picture below for example. The text needs to be: Alle ...
0
votes
1answer
1k views

Got error after execute function Srch.ContentBySearch.getPictureMarkup(... in display template

I am building my custom display template for the search results. I would like to use this code: var title = $getItemValue(ctx,"Title"); var encodedId = $htmlEncode(ctx.ClientControl.get_nextUniqueId()...
1
vote
1answer
659 views

Is it possible to use managed property which is from type lookup?

I have content search webpart. In this webpart I have edited the mapped properties. I see my custom columns, but not from type "lookup". Is it possible to select a lookup field as managed property to ...
0
votes
1answer
1k views

SP 2013 Search Control Template Minimum design

After looking at the Search Results control templates, and attempting to remove pieces of the code to trim down the file to contain on the minimum amount to render an item template. Is there a good ...
4
votes
1answer
2k views

No Display Templates for Popular Items web part from Search-Driven Content category

I have a Popular Items WebPart on my site and in the Display Templates these things are selected: I have saved this site as template, via Save Site as Template option, and created a new site from ...
2
votes
1answer
5k views

Display Templates: how to get url link from current item?

I am building a display template. I would like to know which column of the current item is the url to the item? I see alot of columns which I can select in the mapping columns section of the search ...
0
votes
2answers
2k views

How to set the current site collection path in an "a href" in Display Template?

I am building a display template. There is a control template and a item template. In the item template I have some a href tag. In this a href tag I would like to link to some page inside the current ...
0
votes
3answers
2k views

Toggle div with jQuery in Display Template

I am building a display template in sp2013. I have a control template and a item template. In the item template I have some mapped properties. I show a list with titles. When you click on the title ...
0
votes
1answer
2k views

SP2013: Display Templates, what is overrideValueRenderer doing?

What is the logic behind "overrideValueRenderer"? I see for example this javascript code in the display template: var bestuurderListItemID = $getItemValue(ctx, "ListItemID"); bestuurderListItemID....
0
votes
1answer
526 views

DatePicker in Sharepoint Search Refiner

I am trying to create a custom refiner that uses a begin and end date to filter my search results. The problem is that i want the users to select those dates using a datepicker. The problem i am ...
0
votes
1answer
2k views

SP2013 : Display templates, SP.ClientContext(), Object doesn't support this action

I am building an display template. In the item template I have an onclick function on each item (picture). In this function I have some SharePoint Client Side code. The first row code is: var ...
6
votes
3answers
23k views

SP2013: Get item by id from javascript function?

I have built a display template. In the item template I have some Images from the list "Employees". I have created a function to get some detail info. In this function I have one parameter with the id ...
1
vote
0answers
2k views

sp2013 display templates: How to pass variable value to function as parameter?

I am trying to programming some logic in sharepoint display templates. The power from these display templates is because you can mix html and javascript. I see this comments in one of display ...
1
vote
2answers
1k views

How to make display template with dynamic table cells?

I have cloned the OOTB display template "Control list" and "Item". Now I would like to change this code which is just a simple list of <ul> and <li> tags which are wrapping the content, to ...
0
votes
2answers
72 views

sp2013: Where can I find info about display templates and javascript/jquery to generate fancy search result webparts?

I am using SP2013. I have a list with items. These items I am showing in a search content webpart. Now I like to do fancy things in javascript and jquery. Where can I find more info about these? ...
0
votes
0answers
85 views

SP2013: Display templates with pictures and after select a picture show info (title, description) in another div?

I am using SharePoint 2013. I have a list with 4 columns (title, description, picture, url). I would like to create a search content webpart which is showing a table with the latest 6 items from this ...
0
votes
1answer
2k views

Modify the Hover Panel on the search page [closed]

I would like to customize the hover panel that is shown when I'm over an item on the result page. Is that possible?
5
votes
3answers
4k views

Difference between Content Search Web part and Search Result Web part

I know that Content Search web parts(CSWP) is available only on Enterprise edition. And other great features as compared to Search Result web part (SRWP). When would it be preferable to use either of ...
0
votes
1answer
2k views

Display Template Error: The processing of item fails with error > Object reference not set to an instance of an object

I created a very basic display template to show some properties for a content type, Basically it says, if content type ="Tax Invoice", use this diplay template. All the managed properties exist and ...
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
3answers
3k views

increase the length of title in search result in sharepoint 2013

I am using Sharepoint 2013 and sharepoint 2013 search. when i search for certain items i get results, but the title of certain items shows with a trailing dots after showing some characters of the ...
0
votes
3answers
2k views

Is it possible to change the text color of a search result?

Anyone ever customize the text color of a search result based on the type of content? It came up in a recent conversation and I thought I'd pose the question. I'm thinking display templates could ...
0
votes
1answer
171 views

SP13 Customizing Search Result Items [closed]

I have a custom display template for search items on a SP '13 site. I need to apply a class to the middle 'cell' of each result row. I've tried using css nth-child but this does not seem to work since ...
3
votes
2answers
1k views

Display templates - style block / media queries - remove //<![CDATA[

I'm having trouble inserting style block inside a display template. See code below: <a class="articleListing" href="_#= linkURL =#_" title="_#= $htmlEncode(carouselHeading) =#_"> <...
1
vote
0answers
258 views

Customizing Catalog Item Page

I have a Term-Driven SP '13 site and I am trying to customize the catalog item page. The 2 content types that exist on this site are PDF's & videos. Each content item will have a name, rating (...
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 ...
2
votes
2answers
6k views

SharePoint 2013 Display Templates - Load Javascript BEFORE rendering search results

This is my problem and please let me know if I am approaching it incorrectly. I have a list called "document classes" that holds information such as the retention and revision periods for documents, ...
0
votes
2answers
4k views

showing User field in a display template

I have added CSWP to a page which retrieves 5 recent posts from a community site. Now I want to modify display template to show the thumbnail of the user who created the post. Is it possible?
1
vote
3answers
3k views

Add CSS Classes to ContentBySearch.getPictureMarkup

I'm trying to create a custom design on a Content Search web part. In the display template the var pictureMarkup is created using this line: var pictureMarkup = Srch.ContentBySearch.getPictureMarkup(...
1
vote
1answer
9k views

Getting Correlation ID: 00000000-0000-0000-0000-000000000000 in Content Search Webpart

I keep on getting: Sorry, Something went wrong. Correlation ID: 00000000-0000-0000-0000-000000000000 in my Content Search Webpart. The Content Search Webpart is configured to get results limited ...
3
votes
0answers
3k views

Managed properties in display templates giving null

I created custom display template for ms word documents, I'm able to get values like Path,SPSiteURL, ServerRedirectURL..etc, but when when i try to access 'Site' im getting null in it, I'm trying to ...
0
votes
1answer
944 views

How does one render a security trimmed link in a display template? [solved]

In the old ListView/DataForm XSL based webpart you could throw down some XSLT that would render out a link if the viewing user had sufficient privileges like so: <xsl:choose> <xsl:when ...

1
4 5 6
7
8