I read the documentation and saw that this is possible: node/add/page?field_bar=1,2,3
But how do you code this? I wanted to pass multiple target id, not just one.
I tried this code but this only passes 1 value which is the first field value.
<?php
$l = l( t('Create Package'), 'node/add/package', array('query' => array('field_product_food' =>$node->field_product_food['und'][0]['target_id']) ));
echo $l;
?>
I also tried using an array loop like this:
<?php
$nids = array();
foreach ($node->field_product_food[$node->language] as $index => $item) {
$nids[] = $item['target_id'];
}
$l = l( t('Create Package'), 'node/add/package', array('query' => array('field_product_food' =>$nids) ));
echo $l;
?>
but the result is not like the example from the documentation.
Can somebody help me?
Thank you very much!