When I use image_attach on a node, the thumbnail is attached to the node, the image node is created, but the link on the thumbnail does not point to the image node.

I think the right thing would be to point to the image node (so, you can see in full resolution) instead of pointing to the story (or any other type) node having the attachment.

You can see an example on
http://www2.semescyl.org/?q=node/7 [The story node with image_attach]
http://www2.semescyl.org/?q=node/10 [The image node created]

Comments

jap1968’s picture

Status: Active » Reviewed & tested by the community

I have had a look at the code. You can change the functions theming the teaser and the body in such a way that the image link points to the image node instead of pointing to itself (the container node).

Just place $node->iid instead of $node->nid

# diff image_attach.module image_attach.module.original 
135c135
<   $output .= l(image_display($image, 'thumbnail'), "node/$node->iid", array(), NULL, NULL, FALSE, TRUE);
---
>   $output .= l(image_display($image, 'thumbnail'), "node/$node->nid", array(), NULL, NULL, FALSE, TRUE);
152c152
<   $output .= l(image_display($image, 'thumbnail'), "node/$node->iid", array(), NULL, NULL, FALSE, TRUE);
---
>   $output .= l(image_display($image, 'thumbnail'), "node/$node->nid", array(), NULL, NULL, FALSE, TRUE);

You can see it working at http://www2.semescyl.org/?q=node/7

jax’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Since it can easily be changed by themeing leave it as is and change it in your theme. I for one am glad that the link in the teaser points to the node containing the image, since it is important for ecommerce. When you click the product you want to go to the product page and not to the image page.

The image in the full view, however, can point to the the image. But then you need a way to go back to the original node. If you want to see this changed open a new feature request.

If you really want the default behaviour of the image_attach module changed reopen this issue and provide a clean patch: http://drupal.org/diffandpatch