Howdy
I have added the following code to create a selectable drop down tree of CMS pages for one of my page types:
class ArchivePage extends Page {
static $db = array(
);
static $has_one = array(
'ArchivePageID' => 'SiteTree',
);
function getCMSFields(){
$tree = new TreeDropdownField('ArchivePageID', 'Choose a Parent page to display an archive of the Child pages', 'SiteTree');
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', $tree, 'Content');
return $fields;
}
}
This displays a dropdown selection of all of the pages in the website but when I select a page and click "Save" the box resets to just reading "(Choose)".
I'm sure I'm just making a simple mistake but I've been wading through the documentation and forums and haven't found anything that works.
Hopefully someone can let me know what I'm missing.
Cheers
Tama