I'm trying to sort a list of Appearances within each month, and I have the customized Children control loop working for this in the month template, but in the Year template, first the Children control loop is called and then the customized Children control loop is called, and it returns nothing. The template currently works using standard Children control loops, though:
in Page.php:
public function SortedAppearances(){
// $children will be a DataObjectSet
$children = $this->Children();
if( !$children )
return null; // no children, nothing to work with
$children->sort('AppearanceDate');
// return sorted set
return $children;
}
in template:
<% control Children %>
...
<% if SortedAppearances %>
<% control SortedAppearances %>
...
<% end_control %>
<% end_if %>
...
<% end_control %>
Thanks in advance for any help.
Patrick