Hi,
Thanks for your response.... I had already added the database fields. No problems there - I think. Here is the whole class:
static $icon = "...";
static $db = array(
'Quote' => 'Text',
'Person' => 'Text',
'Organisation' => 'Text'
);
static $has_one = array(
'Photo1' => 'Image',
'Photo2' => 'Image'
);
public function nextPager() {
$pages = DataObject::get("SiteTree", "ParentID = ($this->ParentID + 0) AND Sort > ($this->Sort + 0 )", "Sort", "", 1);
if($pages) {
foreach($pages as $page) {
$v = '<a href="#subHeading-'.$page->URLSegment.'" onclick="return !showHide(\''.$page->URLSegment.'\');">next: '.$page->Title.'</a>';
}
}
return $v;
}
public function previousPager() {
$pages = DataObject::get("SiteTree", "ParentID = ($this->ParentID + 0) AND Sort < ($this->Sort + 0)", "Sort DESC", "", 1);
if($pages) {
foreach($pages as $page) {
$v = '<a href="#subHeading-'.$page->URLSegment.'" onclick="return !showHide(\''.$page->URLSegment.'\');" >previous: '.$page->Title.'</a>';
}
}
return $v;
}
}