[development] D6 Adding an image to a node for viewing

jeff at ayendesigns.com jeff at ayendesigns.com
Tue Feb 1 05:28:10 UTC 2011


I'm hooking nodeapi op=view and I have the node I hook and another in 
the db. The one I hook has field_image which, when hooked, is [0]=>NULL


I load a node from the db, which also has an image field (both are CCK 
imagefields). I want to add its image to the original node, however, I 
need at this point not to add it to field_image, but to 
$node->content->field_image. The problem is that the structure of 
->content is pretty convoluted, ending ultimately in data that is the 
same as what I've copied (when I look at a node with an image), but I 
can't seem to cause that to happen. I tried adding the image structure 
from the source node directly:


                   
$node->content->{$field_name}['field']['items'][$key]['#item'] = 
$image_structure;


but that seems to cause more convolution rather than ending up like the 
$node->content structure from the source node when I display it.


-- 

Ayen Designs
388 Bullsboro Drive #105 · Newnan, Georgia 30263
404-271-9734
Web:ayendesigns.com <http://ayendesigns.com>
Blog: theAccidentalCoder.com <http://theaccidentalcoder.com>
Drupal: j. ayen green <http://drupal.org/user/367108>
IRQ: j_ayen_green
IM (Yahoo) baalwww    (MSN) baalwww at yahoo.com
Skype: ayendesigns

Ayen Designs is a tradename of the computer services division of

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110201/55031440/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ayenlogo
Type: image/jpeg
Size: 8316 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/development/attachments/20110201/55031440/attachment-0002.jpe 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: acmelogo
Type: image/jpeg
Size: 1462 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/development/attachments/20110201/55031440/attachment-0003.jpe 


More information about the development mailing list