Display default content when there are no results returned in Content Search Web Part

Content search web part in SharePoint 2013 is a new feature that can comfortably replace the development of custom web parts from Visual Studio.

You may also like to have a look at the below blog posts regarding Content Search Web Parts:

There might be a requirement when there are no results returned from your CSWP’s query, you would still need to display some default content. Follow the below steps in order to accomplish this:

a. Edit your content search web part.

b. In the tool part, uncheck the option “Don’t show anything when there are no results.”

clip_image001

c. Open the control template of you content search web part, search for the below if condition:

clip_image002

d. The text or the HTML content that you give inside the above if condition would appear in your web part when it has no results to display. You may use it to display any custom empty message when there are no results returned.

Hope you found this to be helpful.