Original link open a new window?
highlife99 - February 10, 2007 - 23:21
| Project: | Image |
| Version: | 5.x-1.x-dev |
| Component: | image.module |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed |
Description
Is it possible using drupal 5.1 and the latest version of image.module to allow the original size image to open in a new window? I searched and did find solutions for older versions but could not get them to function. Any help would be appreciated.

#1
I'm in exactly the same boat! Any info on this would be greatly appreciated!
#2
I would also love to know! I took a look at the function, but am not clear on how to create the new window and place the image inside.... Thanks!
#3
marked http://drupal.org/node/129707 as a duplicate of this.
#4
marked http://drupal.org/node/132826 as a duplicate
#5
marked http://drupal.org/node/136963 as a duplicate
#6
method above is not working for image 5.x-1.x!
#7
Having the same problem with Drupal 5.1 and Image 5.x-1.x.
Got some huge Wallpapers on my page, that do not fit into the content block. So they are overlapped by the right sidebar.
I'm a complete newbie to Drupal and PHP, so I have to relate on you coders out there.
Please help :)
Leiche
#8
I have found the solution. You have to replace the last line in the image_link function, so that it looks like this:
$links['image_size_original'] = array('title' => t('original'), 'href' => 'system/files/' . $node->images['_original'], 'attributes' => array('target'=>'_blank'));Maybe, you will have to change the image path prefix 'system/files/' to match your configuration.
Unfortunately, I have a problem when trying to integrate this as an overriden function in my theme, so that I don't have to change the image.module. I've tried to add the modified function to my template.php:
function scorpions_image_link($type, $node, $main = 0) {
$links = array();
if ($type == 'node' && $node->type == 'image' && !$main) {
$request = ($_GET['size']) ? $_GET['size'] : 'preview';
foreach (_image_get_sizes() as $size) {
if ($node->images[$request] != $node->images[$size['label']]) {
$links['image_size_'. $size['label']] = array('title' => t($size['label']), 'href' => 'node/' . $node->nid, 'query' => 'size=' . urlencode($size['label']));
}
}
if (user_access('view original images') && ($node->images[$request] != $node->images['_original'])) {
$links['image_size_original'] = array('title' => t('original'), 'href' => 'system/files/' . $node->images['_original'], 'attributes' => array('target'=>'_blank'));
} }
return $links;
}
---
www.scorpions.sk
#9
marked http://drupal.org/node/144999 as a duplicate
#10
marked http://drupal.org/node/151136 as a duplicate
#11
how to open image only in the new window? the method above is working but it include the sidebar/theme.
THanks and Regards,
#12
okay here's a patch that takes a first crack at this.
#13
okay i'm going to go ahead and commit this. people have been asking for it for as long as i've been working on the module and i closed a bunch of duplicate issues from before that. we can work any bugs out later.
#14