hi
im trying to promote a page from being a child of ParentPage AA to ParentPAge ZZ afater the page has been published.
here is what i tried
public function onBeforeWrite()
{
$parent = DataObject::get_one("FarmHolder");
$parentid = $parent->ID;
$this->ShowInMenus = 1;
$this->ParentID = $parentid;
$this->write();
parent::onBeforeWrite();
}
its changing the "ShowInMenus " but not the ParentID
How do i change the ParentID yet it is an INDEX of SiteTree table structure
ta
PAt