I have an application where a repeater called 'newsletterrepeater' has field like this
$newsletterrepeater = $page->newsletterrepeater->sort('-date');
foreach($newsletterrepeater as $n){
echo $n->date.$n->title.$n->file;
}
The field types are:
date = dateTime field
title = text field
file = file field
I want to group the entries into months.
See code below where [[ ]] is my unknown code.
foreach ($newsletterrepeater as $n) {
[[ foreach month ]]
<table>
<tr>
<th colspan="3"> [[month]] </th>
</tr>
echo '
<tr>
<td>'.$n->date.'</td>
<td>'.$n->title.'</td>
<td><a target="_blank" href="'.$n->file->url.'">Download Newsletter</a></td>
</tr>';
</table>
}