I'm building out a photo gallery using the grid field type and everything works fine with this code:
{gallery}
<li class="{gallery:switch='one|two|three'}">
<a href="{gallery:photo}"><img src="{gallery:photo:square}" alt="{gallery:caption}" /></a>
{if gallery:caption}<h5>{gallery:caption}</h5>{/if}
</li>
{/gallery}
However the switch tag is outputting the classes in the wrong order which is why I changed them to numbers, really they should be clear||last. The unexpeced output is here:
<ul id="gallery">
<li class="two">
<a href="http://domain.com/uploads/gallery/test16.jpg"><img src="http://domain.com/uploads/gallery/_square/test16.jpg" alt=""></a>
</li>
<li class="three">
<a href="http://domain.com/uploads/gallery/test15.jpg"><img src="http://domain.com/uploads/gallery/_square/test15.jpg" alt="Mmm Caffeine!"></a>
<h5>Mmm Caffeine!</h5> </li>
<li class="one">
<a href="http://domain.com/uploads/gallery/test12.jpg"><img src="http://domain.com/uploads/gallery/_square/test12.jpg" alt="Marshmallows!"></a>
<h5>Marshmallows!</h5> </li>
<li class="two">
<a href="http://domain.com/uploads/gallery/test5.jpg"><img src="http://domain.com/uploads/gallery/_square/test5.jpg" alt="Be Careful"></a>
<h5>Be Careful</h5> </li>
</ul>
Notice that the classes get output two three one two
not
one two three
Any idea why this is happening or how to fix it?