Copy 'SplitList.php' to your project directory. To use on your SS_Lists (eg ArrayList, DataList):
Php file with SS_List:
/*
* Groups SS_List relation "MyList" for templates
* @return ArrayList
*/
public function MyListToCol($num) {
if(!$num) {
$num = 1; //fall back if number is not defined
}
$splitList = SplitList::create($this->MyList());
return $splitList->SplitList($this->MyList(),$num);
}
Template file (.ss)
<% loop $MyList($NumToSplitBy) %>
<div class="row">
<% loop $Children %>
$Title
<% end_loop %>
</div>
<% end_loop %>