You cannot, using token_get_values()
. The code that is returning the value of the token for a CCK field uses just the first value of the field. The function that gets the value of a token for a CCK field (content_token_values()) contains the following code. (See in particular the code between // [1]
.)
$content_type = content_types($node->type);
$node->build_mode = 'token';
$node->content = array();
content_view($node);
// The formatted values will only be known after the content has been rendered.
drupal_render($node->content);
content_alter($node);
$field_types = _content_field_types();
foreach ($content_type['fields'] as $field_name => $field) {
$items = isset($node->{$field_name}) ? $node->{$field_name} : array();
$function = $field_types[$field['type']]['module'] . '_token_values';
if (!empty($items) && function_exists($function)) {
// [1]
$token_values = (array) $function('field', $items, $options);
// [1]
foreach ($token_values as $token => $value) {
$tokens[$field_name .'-'. $token] = $value;
}
}
}
The function called in $function('field', $items, $options)
is, for a text field, text_token_values(), which contains the following code.
if ($type == 'field') {
$item = $object[0];
$tokens['raw'] = $item['value'];
$tokens['formatted'] = isset($item['view']) ? $item['view'] : '';
return $tokens;
}
Despite content_token_values()
passing all the CCK field values, the function just uses the first value.