Programmatically add external link page to site map

Permalink
Anyone know how to add an external link page to the site map programmatically? I'm thinking something like,

$data = array('cName' => 'My External Page', 'url'=>'http://www.concrete5.org/', 'cHandle' => 'my-external-page');
$homePage = Page::getByPath('/');
$ct = SomeExternalCollectionType??
$newPage = $homePage->add($ct, $data);

dzimney
 
dzimney replied on at Permalink Best Answer Reply
dzimney
Nevermind.

Just found the solution. Need to call addCollectionAliasExternal on the page.

$cName = 'My External Link';
$cLink = 'http://www.concrete5.org/';
$newWindow = true;
$homePage = Page::getByPath('/');
$externalPage = $homePage->addCollectionAliasExternal ($cName, $cLink, $newWindow);