Dear All:

How to get image field url in the computed field ? I tried many method but all not work

like:
$image = array_pop(array_pop(field_get_items($entity_type, $entity, 'field_image)));
$path = file_create_url($image->uri);
$entity_field[0]['value'] = $path;

also tried node_load
entity_metadata_wrapper
whatever method does not work

Please help!
thanks

Comments

Hi

$path = file_create_url($entity->field_your_image[und][0][uri]);
$entity_field[0]['value'] = $path;

probably this will solve your problem. You just need to replace "field_your_image" with your image field machine name.

bye