Resolved: $smarty.foreach.entry_loop.last
Posted: Mon Feb 25, 2008 6:02 pm
I'm working on a template where I use serendipity_fetchPrintEntries several consecutive times to get entries for a specific category.... so, I'll get 5 entries from category 1, then 5 entries for category 2, then 5 entries for category 3.
I am fetching with the same entries_custom.tpl file each time. I want to add a unique classname to the LAST entry for each of these lists so I have something like this:
Index.tpl:
entries_custom.tpl:
The first time through this process (ie, fetching for my first category) - it works fine.... entries 1-4 get the class "all_entries" and the 5th entry gets the class "all_entries last_entry", just as expected.
However, when I then fetch for the next categories, they are all receiving the last_entry class, which means $smarty.foreach.entry_loop.last is evaluating to true. I've tried noCache and unique block names on the fetchPrintEntries, but nothing seems to be resetting that foreach.last.
Ideas?
I am fetching with the same entries_custom.tpl file each time. I want to add a unique classname to the LAST entry for each of these lists so I have something like this:
Index.tpl:
Code: Select all
{serendipity_fetchPrintEntries limit="0,5" category="1" noCache="true" fetchDrafts="false" full="false" use_footer="false" template="entries_custom.tpl"}Code: Select all
{foreach from=$entries item="dategroup"}
{foreach from=$dategroup.entries item="entry" name="entry_loop"}
<div class="all_entries{if $smarty.foreach.entry_loop.last} last_entry{/if}">However, when I then fetch for the next categories, they are all receiving the last_entry class, which means $smarty.foreach.entry_loop.last is evaluating to true. I've tried noCache and unique block names on the fetchPrintEntries, but nothing seems to be resetting that foreach.last.
Ideas?