3212 Posts in 847 Topics by 809 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 710 Views |
-
Using Customized Children Loop within Children Loop

2 September 2011 at 3:30pm Last edited: 2 September 2011 3:31pm
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 -
Re: Using Customized Children Loop within Children Loop

2 September 2011 at 8:08pm
SortedAppearances() needs to be in your Page model, not the controller.
-
Re: Using Customized Children Loop within Children Loop

3 September 2011 at 1:43am
Perfect Will...thanks!
| 710 Views | ||
|
Page:
1
|
Go to Top |


