The condition lets us conditionally output elements depending on whether there is at least one search result or not.
This condition can be used in conjunction with the How to create a Search Results page in Oxygen tutorial so that a message can be shown when there are 0 search results.
When there's at least 1 search result:
When there's no search results:
To set this up, you would move everything inside the Template for search results from the other tutorial inside a Div and set this condition on that Div:
After that you would create another Div alongside (at the same level as) the earlier Div and add Heading/Text/Search Form telling the user that there are no results for the term they searched for. Then you'd apply the condition on this Div like so:
Install and activate Code Snippets plugin.
Go to Snippets > Add New.
Title: [Condition] At Least 1 Search Result
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $499 one-time).
Already a member? Log in below or here.