Add Page Programmatically with page attributes
Permalink
Using the example from the pages overview page:
How would one go about adding data to an attribute on the new page? Is this even possible?
$parentPage = Page::getByPath("/sample"); $data = array( 'name' => "sample2", 'cHandle' => "sample2handle", 'cDescription' => "Add page test." ); $pt = CollectionType::getByHandle("page_type_handle"); $newPage = $parentPage->add($pt,$data);
How would one go about adding data to an attribute on the new page? Is this even possible?