I'm writing this code to import a bunch of blog entries from a csv file. I'm just having a wee problem writing the record to the database - It's not creating the SiteTree database record... it is however creating everything else ie. the SiteTree_Versions and SiteTree_Live records, Page and BlogEntry records. I can click the restore action in the CMS which seems to create the SiteTree record but I don't want to have to do that for 200 entries!
Do I need to call some other method or something on $page to insert the regular SiteTree record?
$page = new BlogEntry; $page->Title = 'testing'; $page->MenuTitle = 'testing'; $page->Content = 'testing'; $page->URLSegment = 'testing'; $page->ParentID = 16; $page->ProvideComments = 1; $page->ClassName = 'BlogEntry'; $page->Status = 'Published'; $page->write();
Thanks for any help...