I try to display an icon (different icons, depending on the value of another field) in the computed field. I don't get the idea of what to do in the "computed code" & display code. I made a simple test:

Computed code:

$uri = "/drupal/sites/default/files/icon_avail.png";
$icon_vars = array(
   'path' => file_create_url($uri),
);
$my_img = theme_image($icon_vars);
$entity_field[0]['value'] = $my_img;

I checked the code, it works in the body of a page.

Display code:
$display_output = $entity_field_item['value'];

But this just display nothing. What do I do wrong?

Comments

Anonymous’s picture

Issue summary: View changes
Anonymous’s picture

Issue summary: View changes
Anonymous’s picture

I searched at the wrong end: the problem was that the view was set to "plain text". So it wasn't actually a computed field problem.