Can I change the variables used in entries.tpl {foreach}
Posted: Wed Sep 06, 2006 8:53 pm
Hi all,
I'm trying to change the {foreach} loop in entries.tpl so that the first entry is ignored. The code below works well for sticky entries and where only a single entry was written on the day, but if more than one entry was written on the day then all entries for that day are ignored.
How would I separate out only the first entry? I've tried changing item="dategroup" to item="entry". I've also tried adding a {counter} between the foreach loops, but nothing seems to work.
Thanks, Carl
I'm trying to change the {foreach} loop in entries.tpl so that the first entry is ignored. The code below works well for sticky entries and where only a single entry was written on the day, but if more than one entry was written on the day then all entries for that day are ignored.
Code: Select all
{foreach name="entryloop" from=$entries
item="dategroup"}
{foreach from=$dategroup.entries item="entry"}
{if $smarty.foreach.entryloop.index==0 }
<!-- don't print -->
{else}
Thanks, Carl