$articles = Page::getByPath('/articles'); $collection_type = CollectionType::getByHandle('article'); $query = "select * from other_database.articles"; $rs = $db->execute($query); if ($rs) { while ($arr = $rs->FetchRow()) { $data = array(); $data['name'] = $arr['title']; $data['cDescription'] = $arr['hometext']; $article = $articles->add($collection_type, $data); $article->setAttribute('keywords',$arr['keywords']); $bt = BlockType::getByHandle('content'); $data = array(); $data['content'] = $arr['bodytext']; echo "Adding: $i - ".$arr['title']."<br/>";
Thanks!
Darren