Wednesday, September 18, 2013

Diagnosing Display Template : Classical Overview Of Configuring Item Templates for Search WebParts

 To know more about what is Control Display Template and Item Display Template , Read this post.
 To diagnose  query values in Display template (In search webparts) , Item_Diagnostic item template is  available OOB. 
 To Configure this Item Template in Search Results WebPart's Toolpane,proceed as follows

 1)Navigate to Master Page gallery-->Display Templates-->Content Webparts -->Item_Diagnostic.html
    and Edit the properties to to check Search Result Webpart as Target control Type

 2)Now Edit the Search Page and Search Result WebPart to Select this Item template

 3)I found that in office 365 site this gives following error,but this can be corrected.
    To do so,Download Item_Diagnostic.html,Open with editor 
    search for this code line
    var pictureMarkup = Srch.ContentBySearch.getPictureMarkup(pictureURL, 100, 100, ctx.CurrentItem,    "cbs- picture3LinesImg", line1, pictureId);
and replace it by 
 var pictureMarkup =' ';
 Now rename the file , and upload it in display templates folder and set Target Control Type as Search Result

Display Error: The display template had an error. You can correct it
 by fixing the template or by changing the display template used in either the 
Web Part properties or Result Types.

Cannot call method 'getPictureMarkup' of 
undefined (CoreRender: ~sitecollection/_catalogs/masterpage/Display Templates
/Content Web Parts/Item_Diagnostic.js)
But  this should work in SharePoint 2013
anyways this post is to provide classical overview of Configuring Item Template for Search WebParts
All Item Template for Refinement Search WebPart will be found in Filter folder Under Display Templates folder in MasterPage gallery

No comments: