By Sc0tt on
Thanks for any help with this.
I'm trying to display an image from another node using node_load and imagecache by doing the following:
<?php
//if the CCK node reference field exists
if ($field_inline_1_stock) {
//load the node
node_load($node->field_inline_1_stock[0]['nid']);
//display an image from the node using theme imagecache
print theme('imagecache', '720px_wide', $node->field_stock_picture[0]['filepath']); } ?>
I must not be loading the node properly or completely because I am not seeing the ['filepath'] array imagecache needs to display the image using <?php print_r($node); ?>
Can anyone recommend an approach to get this working?
Thank you,
Scott
Comments
in line 2 try writing $node =
in line 2 try writing $node = .
That worked but has a side effect
I only see the loaded node's arrays and have lost my original node's arrays. Is there any way to keep the original node data?
Found a solution.
Instead of using $node, I used $ref_node:
Thanks very much for your help!
Scott
instead of $node, try
instead of $node, try $new.
just use a different variable name than node.
Remember to change it in the theme (line 3).
edit: you answered it before me :)