2

I'm using the rules to create a new node upon changing the current node publishing status to published. And populate some field based on the updated node field. Im trying to populate a node reference field in the new created node based on the node reference field multiple values from updated node. I wasn't able to use the tokens since it returns single value. How do I get all the values using tokens and return the values in an array (using the php code)?

0

I managed to get multiple value node reference field using the Array Tokens module, an extension to the Token module, providing tokens for multiple-value CCK fields and taxonomy terms.

$authors = array([node:field_op_author-default-array-nid]);
$options = array();

foreach ($authors as $author) {
  $options[] = array('nid'=>$author);
}

return($options);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.