I know this has been discussed alot throughout the Silverstripe community but I can't seem to get it working, maybe I'm just missing something simple!
I basically have the below code, but I wan't to add the class 'last' to every 6th item for CSS purposes.
(ProjectHolder.ss)
<% control Children %>
<div class="project">
<p>info</p>
</div>
<% end_control %>
People seem to be talking about code similar to this....
(ProjectPage.php)
public function IsSixth(){
return ($this->iteratorPos % 6) == 0;
}
But it doesn't work for me... if I do '$iteratorPos' in my .ss file, It prints the iteratorPos, but by trying a simple print_r($this->iteratorPos) in my IsSixth function it returns NULL... so I'm presuming this is the problem.