Keep Results Empty Until User Searches

Scenario:

When you navigate to a custom search page, the Search Results web part is already populated even though you haven’t searched for anything yet.

You want the Search Results web part to remain empty until a user searches for something.

Solution:

Wrap the query template. {?{searchboxquery}}

1. Edit the page
2. Edit the Search Results web part
3. Click “Change query”

4. In the Query text box, wrap the filters {?{searchboxquery}}

5. When you click Test query, the preview should say “This query returned no results.”
6. Click OK to save the query
7. Click OK to save and close the web part properties
8. Save the page

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s