Hey All. Was hoping for a bit of help again.
I have the folowing code defining a page which works great:
Speakerpage.php
<?php
class SpeakersPage extends SiteTree {
public static $db = array(
'RightContent' => 'HTMLText',
);
public static $many_many = array(
'Speakers' => 'Speaker',
'KeyNoteSpeakers' => 'Speaker',
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab( 'Root.Content.Speakers', new ManyManyDataObjectManager(
$this,
'Speakers',
'Speaker'
));
$fields->addFieldToTab( 'Root.Content.KeyNoteSpeakers', new ManyManyDataObjectManager(
$this,
'KeyNoteSpeakers',
'Speaker'
));
return $fields;
}
}
...
Having looked around I can see that the functions I'm looking for to change the default behaviour of the 'results per page' on my cms are
$myDOM->setPerPageMap();
$myDOM->setPageSize();
Problem is I'm not sure as per the above code where to put these functions?
I've tried below but this causes the site to break? Any suggestions of what I am doing wrong?
<?php
class SpeakersPage extends SiteTree {
public static $db = array(
'RightContent' => 'HTMLText',
);
public static $many_many = array(
'Speakers' => 'Speaker',
'KeyNoteSpeakers' => 'Speaker',
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab( 'Root.Content.Speakers', new ManyManyDataObjectManager(
$this,
'Speakers',
'Speaker'
));
$fields->addFieldToTab( 'Root.Content.KeyNoteSpeakers', new ManyManyDataObjectManager(
$this,
'KeyNoteSpeakers',
'Speaker'
));
$fields->setPageSize(50);
return $fields;
}
}
...