I've been scouring through the API docs and issues trying to find how to do this.

I found this http://drupal.org/node/316509#comment-1041902 as a clue, but either I'm doing it wrong or it doesn't work with D6.

I've been trying something along the lines of this:

$node = node_load($nid);

$node->domain_site = TRUE;
$node->domains = array(3, 4);

node_submit($node);
node_save($node);

Someone please tell me I've missed something obvious.

Comments

agentrickard’s picture

You're trying in the wrong place. Use the module API, hook_domainrecords().

billk2’s picture

Status: Active » Closed (fixed)

Thanks. That was the nudge in the right direction I needed.

My code's working great now. Thanks again for your help.