This is a D7 issue only.

If I do node_load() I get an node object with all its field's "paths" to values like this:

<?php 
$node->field_image['en'][0]['uri']; 
?>

Basically I need to know the language or. if its undefined...

As you know If I want to get that field URI from my tpl file is a bit easier: $field_image[0]['uri'];. So this variable already has selected language (or is undefined ['und']).

Is there a function or technique that do this automatically without me "manually" checking for language?

Thanks and i hope we could start a discussion about this issue :)

Comments

pcho’s picture

Try:

$node->field_image[$node->language][0]['uri'];