Hi Velden. Thanks for your useful post.
I made the template like this:
Code: Select all
{if $count->value gt 0}
<div class="newsbox">
<div class="newsboxtitel">NEWS</div>
{foreach from=$items item=entry}
<div class="newsboxtext">
<span class="newsdate">{$entry->postdate|cms_date_format}</span><br>
{$entry->summary|cms_escape:htmlall}<br>
<a href="{$entry->moreurl}"> ZUM ARTIKEL</a></div>
{/foreach}
<div style="clear:both"></div>
</div>
{else}
Test
{/if}
From Debug, $count is available and shows "1", nevertheless nothing from this template is shown, with or without news articles active. Is something missing?
Update: Even when I make 2 articles active I see Debug shows $count ->value = 1. But I see $itemcount does react correctly and shows a value of 0 or 1 depending on the amount of activated articles, so I changed the summary code to: {if $itemcount->value gt 0}, but still the template does never display. Only the else statement "Test" shows up.
I also tried it reversed:
Code: Select all
{if $itemcount->value == 0}
{else}
<div class="newsbox">
<div class="newsboxtitel">NEWS</div>
{foreach from=$items item=entry}
<div class="newsboxtext">
<span class="newsdate">{$entry->postdate|cms_date_format}</span><br>
{$entry->summary|cms_escape:htmlall}<br>
<a href="{$entry->moreurl}"> ZUM ARTIKEL</a></div>
{/foreach}
<div style="clear:both"></div>
</div>
{/if}
With articles activated, does also not show them.
Thanks
Thom