Hi, I’d like to display entries grouped in their categories, but also display content if there are no entries (including the empty category name).
At the moment, if I open a exp:channel:entries loop and there are entries present within that cateogry, then {categories}{cateory_name}{/categories} gets displayed. However If there are no entries {categories}{cateory_name}{/categories} outputs nothing. Perhaps this is logical, but I need to display the category name as a placeholder whether there are entries contained within it or not.
Here’s my the relevant section from the template. Actually this is limited to one category at the moment, my intention is to adjust it to loop the entire category group:
<!--toggle box-->
{exp:channel:entries channel="eis" dynamic="off" category="7" limit="1"}
{if no_results}
<div class="toggle-block">
<a href="#%22class=%22opener" class="opener opener-wide"><span><strong>{eis-category}{category_name}{category_id}{exp:channel:category_heading}{category_name}{/exp:channel:category_heading}</strong></span></a>
<div class="slide-box slide-box-wide">
<div class="np-holder">
<table class="blue-bordered reset-top-border">
<tbody>
{embed="EIS/.eis-results-header"}
{embed="EIS/.no_results-eis-issues"}
{/if}
<div class="toggle-block expanded">
<a href="#%22class=%22opener" class="opener opener-wide"><span><strong>{categories}{category_name}{/categories}</strong></span></a>
<div class="slide-box slide-box-wide">
<div class="np-holder">
<table class="blue-bordered reset-top-border">
<tbody>
{embed="EIS/.eis-results-header"}
{embed="EIS/.eis-results" eis-category="{categories}{category_id}{/categories}"}
{/exp:channel:entries}
</tbody>
</table>
</div>
</div>
</div>Can I achieve this out of the box, or do I need something like NSM Categories?
Thanks in advance, Tony
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.