From 6223d10df49cbbba7d5d8ef55c63d107c364ab68 Mon Sep 17 00:00:00 2001 From: Bert Oost Date: Wed, 22 Aug 2012 16:55:45 +0300 Subject: [PATCH] Update core/components/getfeed/snippet.getfeed.php Added "idx" and "limit" to item placeholders to being able to decide wheter or not in the last entry.
[[+idx:lt=`[[+limit]]`:then=`when not the last`:else=`when last`]]
I use it to separate my items. The [[+total]] placeholder is containing the absolute total and not the limited total. --- core/components/getfeed/snippet.getfeed.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/components/getfeed/snippet.getfeed.php b/core/components/getfeed/snippet.getfeed.php index f54c2eb..356ac90 100644 --- a/core/components/getfeed/snippet.getfeed.php +++ b/core/components/getfeed/snippet.getfeed.php @@ -30,6 +30,8 @@ while (list($itemKey, $item) = each($rss->items)) { if ($idx >= $offset) { if (!empty($tpl)) { + $item['idx'] = ($itemIdx+1); + $item['limit'] = $limit; $output[] = $modx->getChunk($tpl, $item); } else { $output[] = '
'.$idx.': ' . print_r($item, true) . '
';