Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am trying to render an image with imagecache in computed field. Is this possible or am i doing something wrong?
I put code this code in computed code field
$node_field[0]['value']= "theme('imagecache', 'default_150', $node->$field_gallery[0]['filepath'])";
and all i get is errors. How could i do this with computed field if at all?
Comments
Comment #1
Marko B CreditAttribution: Marko B commentedIn main post code had errors so it wasnt going to work anyway
I tried a more proper solutions like, in computed field code
$node_field[0]['value']= theme('imagecache', 'default_150', $node->field_gallery[0]['filepath']);
and in display
$display = $node_field_item['value'];
and another variation is to change display field to $display = theme('imagecache', 'default_150', $node_field_item['value']);
but no output
Comment #2
Marko B CreditAttribution: Marko B commentedHi :-)
Guessing its not possible to use theme function in comptued field but maybe i would need to make outside theming
But i have another problem, can't get some cck variables, like i can output $node->field_gallery[0]['fid']); but cannot output $node->field_gallery[0]['filepath']); any idea why?
Comment #3
mmjvb CreditAttribution: mmjvb as a volunteer commented