We're building a search that has a tabbed results page, we have a tab for each channel, works great apart from when there's no results for a particular channel and we're struggling to find the correct way to hide the tab or display a no result message for each individual tab.
Here's the code we currently have:
<nav class="tabs">
<ul>
<li><a href="#first">Tab 1</a></li>
<li><a href="#second">Tab 2</a></li>
</ul>
</nav>
<div>
<ul>
{exp:search:search_results switch="even|odd" limit="2000"}
{if channel_short_name == "channel_name_1"}
<li class="{switch}">
content here
</li>
{/if}
{/exp:search:search_results}
</ul>
</div>
<div>
<ul>
{exp:search:search_results switch="even|odd" limit="2000"}
{if channel_short_name == "channel_name_2"}
<li class="{switch}">
content here
</li>
{/if}
{/exp:search:search_results}
</ul>
</div>
We've tried the following:
no_results with no joy, because we're using an if channel_short_name it won't know if that specific channel has no results.
Using {count} but this again includes all search results, not channel specific ones so doesn't work.
Using a new {exp:search:search_results} tag for each tab, but seems you can't specify channel in the search tag so this doesn't work either.
Any ideas greatly appreciated!