Posts

Showing posts with the label Display Templates

SharePoint Online/2013 Replace no results default text ‘Nothing here matches your search’ from search results web part

Image
  As we all aware, SharePoint search have great potential to provide very powerful search solution. Couple of new webparts are added in SharePoint 2013, like Content Search web part for which I should use rather a word "Smart" search web part. With a new rendering mechanism, content search webpart becomes more and more simple to edit and customize. That mechanism is called "Display Templates" and these are based upon simple Json to HTML templates. I recently has faced a project scenario, where I was asked to replace the part of search result web part and I provided a solution by updating search display template. Requirement:   When we add a search result web part on any result page along with a search text box web part to enter search keywords. Search results will be displayed in web part if keyword matches any text. When we add both these web parts on page and before entering the search term also the results web part show  “Nothing here matches your search” (as sho...

Display Template Deployment in SharePoint 2013

Hi Guys, New way to transform search result introduces in SharePoint 2013 which provide a good user experience through the use of display templates. It is far better then using XSLT in SharePoint 2010 to use to customize that display. It is really frustrating while understanding XSLT display templates. The great thing about display templates is that you create them by leveraging skills that many developers already possess: HTML and JavaScript. The most likely approach to creating display templates is to start with an existing display template HTML file and customize it. It’s not too difficult when you get the hang of the _#= (underscore pound equals) syntax. It’s very important to understand what happens when you edit that HTML file. When you click save SharePoint creates a JavaScript file and associates the two together. (The same thing happens when creating master pages using the design manager but HTML to MASTER file). When you select your display template in the content by search w...