Hello,
in the Silverstripe CMS Backend, you are able to create new pages using the tree view on the left side.
Now my intention is to create new pages with the use of formular data. Users should be able to create a new page without using the backend.
My first try is:
function doSubmit() {
$subpage = new Page();
$subpage->setParent($this); //also tried $subpage->parentID = $this->ID;
$subpage->Title = ".."; //set attributes
...
$subpage->save();
}
The function is in the Holder of Page and gets called by the form. Page and PageHolder are extended from SiteTree.
My problem is, that after the function was called, there is no new subpage. In the database is only a new entry in "SiteTree", but without any fields filled (all NULL).
Would be nice if someone has a clue what i'm doing wrong or gives a description to create subpages. :)
Greetings