This is perhaps obsolete in 6 due to the new theming stuff that's now possible...

Basically, you can't get to just the IMG tag or the URL for the image from node templates, because the $node object holds: $node->content['image_attach']['#value'] which has a wrapping DIV and a link to the image node.
This hampers a lot of things you'd be able to do with attached images otherwise -- eg applying your own URL.

The URL isn't available plain in the $node because the URL isn't loaded until the theming functions theme_image_attach_body & _teaser.
The split between data and theming doesn't seem quite right to me.

I think at line 273, the plain URL of the image should be loaded:

        $node->content['image_attach'] = array(
          '#value' => theme("image_attach_{$teaser_or_body}", $node),
          '#weight' => variable_get("image_attach_weight_{$teaser_or_body}_{$node->type}", 0),

Comments

drewish’s picture

roll a patch ;)

joachim’s picture

On 5.x?
I'm going to be taking a stab at the theme layer for 6.x... (unless you've got it covered?)

joachim’s picture

Status: Active » Closed (duplicate)