Hi folks today we are going to discuss display templates in SharePoint Server 2013 as an intro and then in Part II I’ll modify and show you guys the output of my Search page so let’s just jump into the topic.
Display templates in SharePoint
SharePoint Display templates are templates used in Web Parts that use search technology (referred to in this article as Search Web Parts) 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.
You can navigate Display Template by below URL just replace yours
E.g.- https://onlysharepoint2013.sharepoint.com/sites/Bhawana/_catalogs/masterpage/Forms/AllItems.aspx
Customize search results by using result types and display templates in SharePoint
Below under Search, you can find two template files that start from Control and Item, again divided into .html and .js. So the search result page when we are looking .html will contain all design-related elements like table, divs, panels like that, and in .js file all related scripts used in .html.
So if you want to customize your search result page below are the elements and controls we need to take care of. And based on our need we can alter, remove, hide and update. In fact, we have full control over the elements visible on this page. Also, we can restrict the audience by viewing and accessing the search contents.
You may like following sharepoint search tutorials:
- Documents are not showing up in Search Results in SharePoint 2013
- To start seeing previews please log on by opening the document in SharePoint Online search result Web part
- Calling SharePoint Search Using REST from JavaScript
- Create and use custom result source in content search web part in SharePoint Online
- JQuery News Ticker using content search web part in SharePoint 2013
- JQuery accordion using content search web part in SharePoint server 2013
- JQuery Tabs using content search web part in SharePoint 2013
- Create a simple bootstrap navigation menu using content search web part in SharePoint 2013
This SharePoint tutorial, we learned how to customize search results by using result types and display templates in SharePoint Online/2013/2016.
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com