I was wondering if its possible to set the ParentID of a pagetype to specific page. The pagetype is being controlled by a ModelAdmin instead of the pages interface. I've tryed setting the $defaults array in the __construct() but I get a class does not exist error
static $defaults;
/**
* Static methods
* ----------------------------------*/
public function __construct() {
$mainListingPage = SiteTree::get_by_link("listings");
$this->defaults = array(
"ParentID" => $mainListingPage->ID,
);
parent::__construct();
}
Should I just handle it in the onBeforeWrite ?