Custom Module Search Results IF Statement

Would it be possible to setup a liquid “if statement” that if there are no results for a ‘Custom Module’ search that other content is shown instead (from a snippet etc)?

Any ideas of how you would go about this?

If there are no items in the search does it show the emptyMessage string??

if so try this…

{% component type:"module", source: "something", layout: "List", limit: "500", object: "collection", emptyMessage: "\{\% include '/_assets/includes/test.inc' \%\}" %}

Found that this works passing in things to the emptyMessage param.

I’ll also @ you on the slack discussion we had about this a month ago… might help

1 Like

That is fabulous! Thank you @James most appreciated.