I used the suggested code from emaudio.theme.inc, but I get I get the following e error when theming node.tpl.php:
Fatal error: Cannot use object of type stdClass as array in /etc/drupal/6/sites/all/modules/emfield/contrib/emaudio/emaudio.module on line 299

My code:
$field_type = 'field_embaudio';
$system_types = _content_type_info();
$field = $system_types['fields'][$field_type];
$field['widget'] = $system_types['content types'][$node->type]['fields'][$field_type]['widget'];
echo theme('emaudio_audio_embed', $field, $node->{$field_type}[$i], 'emaudio_embed', $node);

Comments

gghh2’s picture

Status: Active » Closed (fixed)

My field name is : field_blog_embed_audio

 $field_type = 'field_blog_embed_audio';
$system_types = _content_type_info();
$field = $system_types['fields'][$field_type];
$field['widget'] = $system_types['content types'][$node->type]['fields'][$field_type]['widget'];
print theme('emaudio_audio_embed', $field, $node->field_blog_embed_audio[0], 'emaudio_embed', $node); 

The last line is wrong !!

This line

print theme('emaudio_audio_embed', $field, $node->field_blog_embed_audio[0], 'emaudio_embed', $node);

Must be this one :

print theme('emaudio_audio_audio', $field, $node->field_blog_embed_audio[0], 'emaudio_embed', $node);