Monday 12 January 2015

SharePoint 2013 Search Centre - The display template had an error



After creating search centre in SharePoint 2013 I have faced below error.

Solution:

Activate Search Centre Web Parts& templates features in Site Collection features.


One of my project, client wants date in SharePoint 2013 Search Centre with this format
(December 22, 2014)

SharePoint 2013 provide multiple template to modify.


SharePoint Designer 2013 -> Master Page Gallery -> Design Template -> Search

SharePoint 2013 Search Centre with date


How to change the way search results are displayed in SharePoint Server 2013

Using Query Rules, Result Types and Display Templates for a Custom Search Sales Report in SharePoint 2013


An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.

A generic application error on the server or an Unxpected Error may be the error you are getting most of the time. If so then the current custom error settings for the application prevent the details of the application error from being viewed. As I work in SharePoint 2007 the first things I do are listed below. First you have to open the web.confing file of the application C:\inetpub\wwwroot\wss\VirtualDirectories\<port>.
 
  1. Debug="true" instead of the default of Debug="false"
  2. CallStack="true" instead of the default of CallStack="false"
  3. CustomErrors="Off" instead of the default of CustomErrors="On"
I have done this but still I got the custom error message like below.
Server Error in '/' Application.

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.
Details: To enable the details of this specific error message to be viewable on the local server machine, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".

Then I found out SharePoint 2010 has a second web.config file located at the
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\web.config
That second web.config file contains the customErrors section that needs to be set to off. 
Central Administration has a second web.config file too if you need to see error descriptions there:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\ADMIN\web.config
From customErrors section set the value to off.

These settings help you to get the exact error message

SharePoint 2013 Search & Refinement configuration