{"action":"created","issue":{"url":"https://api.github.com/repos/tomj74/chunk-templates/issues/13","labels_url":"https://api.github.com/repos/tomj74/chunk-templates/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/tomj74/chunk-templates/issues/13/comments","events_url":"https://api.github.com/repos/tomj74/chunk-templates/issues/13/events","html_url":"https://github.com/tomj74/chunk-templates/issues/13","id":120153345,"number":13,"title":"while looping, how can i handle pagination","user":{"login":"harishd84","id":7713527,"avatar_url":"https://avatars.githubusercontent.com/u/7713527?v=3","gravatar_id":"","url":"https://api.github.com/users/harishd84","html_url":"https://github.com/harishd84","followers_url":"https://api.github.com/users/harishd84/followers","following_url":"https://api.github.com/users/harishd84/following{/other_user}","gists_url":"https://api.github.com/users/harishd84/gists{/gist_id}","starred_url":"https://api.github.com/users/harishd84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harishd84/subscriptions","organizations_url":"https://api.github.com/users/harishd84/orgs","repos_url":"https://api.github.com/users/harishd84/repos","events_url":"https://api.github.com/users/harishd84/events{/privacy}","received_events_url":"https://api.github.com/users/harishd84/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-03T11:52:13Z","updated_at":"2015-12-04T06:42:47Z","closed_at":null,"body":"while looping through the objects, how can i set counter to start with\r\nExample: i have ten records, first i will get only five and display them with serial number, if i go to next page i get another five records and now i to have start with serial number from 5. Please help me with this"},"comment":{"url":"https://api.github.com/repos/tomj74/chunk-templates/issues/comments/161891415","html_url":"https://github.com/tomj74/chunk-templates/issues/13#issuecomment-161891415","issue_url":"https://api.github.com/repos/tomj74/chunk-templates/issues/13","id":161891415,"user":{"login":"tomj74","id":2747799,"avatar_url":"https://avatars.githubusercontent.com/u/2747799?v=3","gravatar_id":"","url":"https://api.github.com/users/tomj74","html_url":"https://github.com/tomj74","followers_url":"https://api.github.com/users/tomj74/followers","following_url":"https://api.github.com/users/tomj74/following{/other_user}","gists_url":"https://api.github.com/users/tomj74/gists{/gist_id}","starred_url":"https://api.github.com/users/tomj74/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomj74/subscriptions","organizations_url":"https://api.github.com/users/tomj74/orgs","repos_url":"https://api.github.com/users/tomj74/repos","events_url":"https://api.github.com/users/tomj74/events{/privacy}","received_events_url":"https://api.github.com/users/tomj74/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T06:42:47Z","updated_at":"2015-12-04T06:42:47Z","body":"Update: implemented a filter for slicing by page, which takes two args a la ```page(pageNum,pageSize)```\r\n```\r\n{% $list|page($pg, 10) %}\r\n```\r\n\r\nThis filter will be available in next release.  For example, you could now break a list into rows of five elements each - the outer loop jumps to every fifth element (the third slice arg is a step function), and the inner loop iterates over just the items on each page.\r\n```\r\n{% loop in $x|slice(::5) as $a counter=$pg,1 %}\r\n  Page {$pg}: {% loop in $x|page($pg,5) as $item divider='-'}{$item}{% endloop %}\r\n{% endloop %}\r\n```\r\n\r\nIf $x is the alphabet, this will output:\r\n```\r\n  Page 1: A-B-C-D-E\r\n  Page 2: F-G-H-I-J\r\n  Page 3: K-L-M-N-O\r\n  Page 4: Q-P-R-S-T\r\n  Page 5: U-V-W-X-Y\r\n  Page 6: Z\r\n```"}}