Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Drupal:添加到无图像cck字段的链接&;缩进_Php_Drupal_Cck_Ubercart - Fatal编程技术网

Php Drupal:添加到无图像cck字段的链接&;缩进

Php Drupal:添加到无图像cck字段的链接&;缩进,php,drupal,cck,ubercart,Php,Drupal,Cck,Ubercart,我正在为drupal ubercart的产品页面制作主题,但似乎无法将图像作为链接。这就是我到目前为止所做的: <?php if ($node->field_image_cache[0]['filepath']): print theme('imagecache', 'uc_thumbmail', $node->field_image_cache[0]['filepath']); endif; ?> 链接必须链接到完整的图像,这是与uc缩略图相反的

我正在为drupal ubercart的产品页面制作主题,但似乎无法将图像作为链接。这就是我到目前为止所做的:

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

链接必须链接到完整的图像,这是与uc缩略图相反的产品完整图像,我也在尝试将其制作成一个灯箱,但我很乐意让链接正常工作。

试试看

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


不确定这是否是您想要的,但它应该在Drupal 7上打印来自cck的链接,您可以利用原生l()函数:

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