<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Page comments</title>
		<link>http://www.ssbits.com/home/</link>
		

		
		<item>
			<title>Comment by 'Matt Clegg' on Manipulating every Nth item in a &lt;% control %&gt; loop</title>
			<link>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_655</link>
			<description>You can also include some error checking;

public function isiteratorPos($i=2){
		return $this-&gt;iteratorPos&gt;0 &amp;&amp; ($this-&gt;iteratorPos % $i) == 0;
}</description>
			<pubDate>Thu, 06 May 2010 13:53:34 -0500</pubDate>
			<author>Matt Clegg</author>
			<guid>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_655</guid>
		</item>
		
		<item>
			<title>Comment by 'Chris' on Manipulating every Nth item in a &lt;% control %&gt; loop</title>
			<link>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_629</link>
			<description>How about:

	function Position(){
		switch($this-&gt;iteratorPos % 3) {
			case 0: return 'first'; break;
			case 1: return 'second'; break;
			case 2: return 'third'; break;
		}
	}

then you can just go eg: &lt;li class=&quot;$Position&quot;&gt;</description>
			<pubDate>Fri, 23 Apr 2010 01:54:22 -0500</pubDate>
			<author>Chris</author>
			<guid>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_629</guid>
		</item>
		
		<item>
			<title>Comment by 'yurigoul' on Manipulating every Nth item in a &lt;% control %&gt; loop</title>
			<link>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_588</link>
			<description>After some playing with it I noticed (as I have done before) that in order to get it to work on page objects you have to add it to the model and not to the controler ...</description>
			<pubDate>Sun, 28 Feb 2010 07:31:13 -0600</pubDate>
			<author>yurigoul</author>
			<guid>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_588</guid>
		</item>
		
		<item>
			<title>Comment by 'Richard Rudy' on Manipulating every Nth item in a &lt;% control %&gt; loop</title>
			<link>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_552</link>
			<description>Is there a way to get this working on a Children control that returns more than one DataObject Type. Adding the function to each</description>
			<pubDate>Wed, 13 Jan 2010 08:21:39 -0600</pubDate>
			<author>Richard Rudy</author>
			<guid>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_552</guid>
		</item>
		
		<item>
			<title>Comment by 'Alan Tucker' on Manipulating every Nth item in a &lt;% control %&gt; loop</title>
			<link>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_475</link>
			<description>Will this work within any class?</description>
			<pubDate>Wed, 18 Nov 2009 05:08:15 -0600</pubDate>
			<author>Alan Tucker</author>
			<guid>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_475</guid>
		</item>
		
		<item>
			<title>Comment by 'vitaliy' on Manipulating every Nth item in a &lt;% control %&gt; loop</title>
			<link>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_459</link>
			<description>This code not work
becose iteratorPoss = 0 
where I mast add 
$this-&gt;iteratorPos++</description>
			<pubDate>Tue, 10 Nov 2009 06:23:11 -0600</pubDate>
			<author>vitaliy</author>
			<guid>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_459</guid>
		</item>
		
		<item>
			<title>Comment by 'aram' on Manipulating every Nth item in a &lt;% control %&gt; loop</title>
			<link>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_365</link>
			<description>Hi Markus

That sounds like a great idea, if you want to write a snippet that would be great, or you can just send me your code and i will add it to this snippet :)

Thanks

Aram</description>
			<pubDate>Sat, 18 Jul 2009 10:38:40 -0500</pubDate>
			<author>aram</author>
			<guid>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_365</guid>
		</item>
		
		<item>
			<title>Comment by 'Marcus' on Manipulating every Nth item in a &lt;% control %&gt; loop</title>
			<link>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_362</link>
			<description>Great post about a function that really should be part of the core.

I've found myself writing a couple of utility functions to extend the template language but I didn't like having to put them in my Page class or inte class of the dataobject in question.

I solved this by decorating so I can keep my utility functions separate from my page/dataobject files.

I would be most willing to write a snippet about this if you think going the decorator route instead of putting them directly in the classes is a worthwile one.</description>
			<pubDate>Fri, 17 Jul 2009 17:45:02 -0500</pubDate>
			<author>Marcus</author>
			<guid>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_362</guid>
		</item>
		
		<item>
			<title>Comment by 'Aram ' on Manipulating every Nth item in a &lt;% control %&gt; loop</title>
			<link>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_361</link>
			<description>Thanks guys! They both worked perfectly so I have changed the post accordingly :)</description>
			<pubDate>Fri, 17 Jul 2009 07:03:08 -0500</pubDate>
			<author>Aram </author>
			<guid>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_361</guid>
		</item>
		
		<item>
			<title>Comment by 'nick jacobs' on Manipulating every Nth item in a &lt;% control %&gt; loop</title>
			<link>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_360</link>
			<description>Hi all,  I use this one (with modulous) and it works pretty well....passing in the number of iterations makes it a little more flexibe:

public function SplitList($val=3) { 
return ($this-&gt;iteratorPos ) % $val == 0; 
}</description>
			<pubDate>Thu, 16 Jul 2009 15:06:00 -0500</pubDate>
			<author>nick jacobs</author>
			<guid>http://www.ssbits.com/manipulating-every-nth-item-in-a-control-loop/#PageComment_360</guid>
		</item>
		

	</channel>
</rss>
