Hi,

I have Ubercart webshop module installed. (great one!)
As an addition, I use 'Views' module to display products in a teaser view, becouse Ubercart is somewhat limited this way. (UBrowser is too simlpe for my needs)
I have created custom templates for 'product' node type. Both the teasers and the body have templates.
Images will be displayed this way:

<?php 
 print $node->content['image']['#value'];
?>

I'd like to define a HTML link to the image in the teaser's template, that points to the node, just like the 'node title' does.

How should the code look like?

I've checked the teaser variables, but I can get on with them.
I'm not able to even print out the path of the node, using variable: $node->path

Could anyone advice?

Thanks in advance,

Zsigmond

Comments

Anonymous’s picture

update:

neither

print $node->links['node_images_edit']['href']; 

nor

print $node->path; 

return any output...

Anonymous’s picture

The solution seems to be this one: http://drupal.org/node/187821

Let's check!

Anonymous’s picture

Yesss!

The code snippet, I was looking for:

<a href="<?php print drupal_get_path_alias('node/'.$node->nid) ?>"><img border="0" alt="<?php print $node->field_image_cache[0]['alt']?>"  src="files/imagecache/product/files/<?php print $node->field_image_cache[0]['filename'] ?>"/>
</a>

Thanks! :)

Check out at: http://www.lingvini.com/debian_polo

[SOLVED]

Anonymous’s picture

Assigned: Unassigned »
Status: Active » Closed (fixed)

Rock'N'roll! :)

Anonymous’s picture

fix:

Domain should be hardcoded in the code, becouse Views module handles path values at a real strange way.

<a href="http://www.mydomain.com/<?php print drupal_get_path_alias('node/'.$node->nid) ?>"><img border="0" alt="<?php print $node->field_image_cache[0]['alt']?>"  src="http://www.mydomain.com/files/imagecache/product/files/<?php print $node->field_image_cache[0]['filename'] ?>"/>
</a>