开发者

Drupal: add a link to a image free cck field & re-indent

I am working on theming the product page for drupal ubercart and can't seem to get the image to be a link also. This is what I have so far:

<?php  
if ($node->field_image_cache[0]['filepath']):
    print theme('imagecache', 'uc_thumbmail', $node->field_image_cache[0]['filepath']); 
endif;
?>  

The link has to link to the full image which is product_full opposed to 开发者_如何转开发uc_thumbnail and I'm trying to make it into a light box also but I will be happy to even get the link to work.


try

<a href=""><?php print theme_imagefield_image($node->field_image[0]); ?></a>

not sure if that is what you want but it should print a link from cck


On Drupal 7, you may take advantage of the native l() function:

echo l(theme_imagefield_image($node->field_image[0]), "link-destination", Array("html"=> true)) ;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜