Closed (duplicate)
Project:
Image
Version:
6.x-1.x-dev
Component:
image_attach
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Feb 2008 at 09:02 UTC
Updated:
8 Aug 2009 at 23:41 UTC
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
Comment #1
drewish commentedroll a patch ;)
Comment #2
joachim commentedOn 5.x?
I'm going to be taking a stab at the theme layer for 6.x... (unless you've got it covered?)
Comment #3
joachim commentedDuplicate of #412288: restructure theme_image_attach_body/teaser