Вам необходимо переопределить изображение , связанное с полем форматера изображения в вашей теме, созданной theme_imagecache_formatter_imagelink()
. Добавьте это к вашей теме template.php
:
function mytheme_imagecache_formatter_mypreset_imagelink($element) {
// Inside a view $element may contain NULL data. In that case, just return.
if (empty($element['#item']['fid'])) {
return '';
}
// Extract the preset name from the formatter name.
$presetname = substr($element['#formatter'], 0, strrpos($element['#formatter'], '_'));
$style = 'imagelink';
$item = $element['#item'];
$item['data']['alt'] = isset($item['data']['alt']) ? $item['data']['alt'] : '';
$item['data']['title'] = isset($item['data']['title']) ? $item['data']['title'] : NULL;
$imagetag = theme('imagecache', $presetname, $item['filepath'], $item['data']['alt'], $item['data']['title']);
$path = file_create_url($item['filepath']);
$class = "imagecache imagecache-$presetname imagecache-$style imagecache-{$element['#formatter']}";
return l($imagetag, $path, array('attributes' => array('class' => $class, 'target' => '_blank'), 'html' => TRUE));
}
Замените mytheme
и mypreset
коротким названием вашей темы и коротким именем вашей предустановки соответственно. Эта функция идентична theme_imagecache_formatter_imagelink()
за исключением последней строки, которая добавляет атрибут target="_blank"
к ссылке.