Hello,
I have a SeriesPage and a SeriesHolder. Each SeriesPage has a manymany set of Features.
class SeriesPage extends Page {
...
static $many_many = array(
'SeriesFeatures' => 'Features'
);
...
What I need to do is sort and limit these features. I was able to sort them for the SeriesPage by using the following...
class SeriesPage_Controller extends Page_Controller {
function SeriesFeaturesList($limit = null) {
$data = $this->getManyManyComponents('SeriesFeatures', '', 'DisplayOrder', '', $limit);
return $data;
}
...
(DisplayOrder is an int field that I use to sort the items.)
When I place this in my template for SeriesPage...
<% control SeriesFeaturesList(7) %>
$Feature
<% end_control %>
all works fine, however when I place it in the SeriesHolder like this...
<% control Children %>
...
<% control SeriesFeaturesList(7) %>
$Feature
<% end_control %>
...
<% end_control %>
I get nothing, no errors (in dev mode), just nothing displayed.
Any guidance would be appreciated.
Thanks,
Ryan