Hello,

I would like to use the excellent theme function to output imagecache images (e.g. theme('imagecache', 'squaretumbnail', $node->field_albumimage[0][filepath]);)

While this function works perfectly I would like to add a hyperlink to this thumbnail that leads to the node where the image is shown.

I tried this

print 'nid.'">Only local images are allowed.field_albumimage[0][filepath].'">';

However, it doesn't show the thumbnail but the original size image scaled down to 107x78 pixels. This is very time and resource intensive and is not a clean way.

Is there a possibility to combine the theme function with a hyperlink? That would be great.

Thanks
Roger

Comments

Militopedia’s picture

Found the solution!

print '<a href="/node/'. $node->nid.'"><img height="78" width="107" title="" alt="" '.theme('imagecache', 'squaretumbnail', $node->field_albumimage[0][filepath]).'</a>';

:-)

Cheers,
Roger

drewish’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.