Hi,
I am trying to create a content type that displays different images based on conditions set in a CCK Computed field. An example for this may be displaying different images for different months or different images for different statuses set by another field. The images are stored in the 'files' directory and the if statement is working as expected, I tested it by sending text to the output instead of the image.
$t=getdate();
$today=date('Y-m-d',$t[0]);
$due_date = $node->field_due_date[0]['value'];
if ($due_date < $today) {
$node_field[0]['value'] ="Red, due date is - " . $due_date;
} else {
$node_field[0]['value'] = "Green, due date is - " . $due_date;
}
Can anyone help me replace the '$node_field[0]['value'] ="Red, due date is - " . $due_date' row with a statement that will output an image named red.gif?
Comments
Any ideas anyone?
Any ideas anyone?
...
change the conditional to:
(In other words, we want the field to hold a keyword that describes the status of this library book(?))
Then, in the 'Display Format' box (make sure 'Display this field' is checked), do: