A few more stops on Display Templates and Search Webparts

Hello SharePointer 🙂

Till now we have seen the quick facts for display template in my previous blog post.Here, I am going to explain further more points to look over before we actually implement the requirements.

Few more stops

Very first requirement in order to have content on web part is running mode of Search Service and the next is enabled publishing feature in site.In SharePoint Online, Search service will be taken care by Microsoft 🙂 and you are good to go to work with Search Web parts for On Premises or Online SharePoint Site.

Alright, at this point we will have look on content what we can display as per the need. Actually ,there are two types of web part we can use to leverage the search:

  1. Content Search Web part: Specifically meant to display your content/products in designed view using dedicated display templates.
  2. Search Results Web part: Specifically meant to modify the view of search results via display templates.

Actually, the content we use from search considered as results types whether its collection of page/post/site/email/Image etc. which are associated with specific display templates as explained in Microsoft article.

Both the web parts concentrated with more similar functionality, however the purpose of using them is a bit different. I have also mentioned the different types of settings availability in both the web parts as demonstrated in following table:

search webpart difference

The best part of these web parts is that it gives you the facility to build up the custom query via query variables to filter the items from selected result types.For more information about query variables to be entered in Keyword filter and Property Filter, please have a look on this Microsoft article.

AND -> Last but not least, Search Web parts are security trimmed by default and you don’t require to control user’s security setting explicitly 🙂 , I am loving it !!

Note: We can also use the content query web part to display the content however it will display the results only from the current site collection while Search web parts are leveraging the cross-site publishing feature and that’s much faster than content query web part.CQWP results are rendered by XSLT ( XML file ) while CSWP results are rendered display Templates ( HTML file ).Please have a look on this article that explains understanding about deciding CSWP or CQWP.

Next we will look over on customization of Search web parts .

Happy SharePointing,

Stay Gifted,Stay Young !

Dipti Chhatrapati

Dipti Chhatrapati is a SharePoint specialist currently working as a Senior Consultant for CapGemini in Mumbai, India. She has more than 9 years of experience in application development, design, maintenance, administration and is continuously working with improving her skills and keeping them up to date. As a developer, project leader and SharePoint Business Analyst, she has been an extensive user of Visual Studio and Team Foundation Server throughout her career. Dipti is very passionate about music, sports, and arts and loves to spend her free time learning new things, socializing with friends and family, cooking, exercising and singing.

Leave a Reply

1 Comment on "A few more stops on Display Templates and Search Webparts"

Notify of
Sort by:   newest | oldest | most voted
SharePoint Online Training

Nice, looking forward to seeing these new posts especially with the scenario you’re building for SharePoint blogs!

Animated Social Media Icons by Acurax Wordpress Development Company
Visit Us On TwitterVisit Us On FacebookVisit Us On Linkedin