Determining "no entries to print"
Posted: Tue Jan 26, 2016 2:54 am
Most templates use a format to iterate through entries or to determine that there are no entries to print:
I am working on a theme where I want to know right away in entries.tpl if there are no entries rather than wait until the {foreachelse} and {if not $plugin_clean_page} to print the "no entries" message.
Is there a good reason why, before the nested {foreach}'s that I couldn't just do a quick {if !$entries}? Is there a negative side to this?
Code: Select all
{foreach from=$entries item="dategroup"}
{foreach from=$dategroup.entries item="entry"}
.... do entry stuff here....
{/foreach}
{foreachelse}
{if not $plugin_clean_page}
<p class="nocontent">{$CONST.NO_ENTRIES_TO_PRINT}</p>
{/if}
{/foreach}
Is there a good reason why, before the nested {foreach}'s that I couldn't just do a quick {if !$entries}? Is there a negative side to this?