I am using imce with fckeditor and image resize filter, Everything seems to work, although i want images linked to the original image to popup in a new window, target _blank . but using this setting seems not to work. it just links in the same window/tab. I have the image placed in as an image as normal, then in the link settings i enter the images location and tell it the target is _blank.

Has anyone else had this problem and been able to diagnose it? any help is appreciated.

Comments

ufku’s picture

Project: IMCE » FCKeditor - WYSIWYG HTML editor
Version: 6.x-1.2 » 6.x-1.x-dev
Category: bug » support
wwalc’s picture

Project: FCKeditor - WYSIWYG HTML editor » Image Resize Filter
Version: 6.x-1.x-dev » 6.x-1.1
Category: support » feature

I think this ticket should changed into a feature request and moved to Image Resize Filter issue tracker.
I've checked the source code and at this moment it seems that there is no way to tell this filter to add target "_blank" attribute.

  if ($settings['link']) {
    $class = !empty($settings['class']) ? ' class="'. $settings['class'] .'"' : '';
    $output = '<a href="'. $image['original'] .'"'. $class . '>'. $output .'</a>';
  }
luckysmack’s picture

for the time being, for others that may have a similar problem until this is fixed, to help alleviate this issue I have installed the extlink module
But I would still rather be able to have it setup with this method as extlink is a pain to setup for internal image links to have open up in a _blank window.

quicksketch’s picture

Title: opening links with target _blank do not work » Add target=_blank to Resize Links

I'm not sure if this should be added. We've already got the ability to add a rel and class attribute, you could implement this very easily by adding some JavaScript to your theme:

$('a.whatever-class').attr('target', '_blank');
luckysmack’s picture

where would we add this in the themes files?

quicksketch’s picture

There are a lot of options, but this would probably be easiest:

- Make a new text file called "utilities.js" and add it to your theme's root directory
- Open the .info file of your theme and add the line scripts[] = utilities.js to the file.
- Edit the utilities.js file and enter the contents:

Drupal.behaviors.resizedImagesLink = function(context) {
  $('a.whatever-class', context).attr('target', '_blank');
}

- Then make sure to empty your caches, click "Clear all caches" on admin/settings/performance to make Drupal rescan the .info file and add the JS file.

luckysmack’s picture

Ok, that did not work, so I naturally figured i needed to make 'a.whatever-class' changed to a class on my image links. And after using firebug to inspect the images a litle more i spotted something i didnt spot before. There is a duplicate link for the same image, one with and one without the 'target="_blank" ' attribute. I edited the html to remove the one without the blank and no change, so i re-edited the link without the target to have the target and it worked perfectly. Though this is with the changed with the utilities.js in the theme folder. This seems like the bug that is preventing this from happening. But im not entirely sure the issue is with this module. When i view the source for my page the double link is there, but im using wysiwyg with FCKEditor. By default FCK is disabled and you have to enable 'rich text mode', and in both instances, including viewing source when fck is enabled, the double link is not shown and the link without the ' target="_blank" ' is not shown. Here is what i have:

Real code from viewing source:

<a href="http://shamce.net/sites/shamce.net/files/user_uploads/3-bigmack/article/node-30/2009/04-21/config_date_and_time_jpg_16967.jpg" target="_blank">
<a href="http://shamce.net/sites/shamce.net/files/user_uploads/3-bigmack/article/node-30/2009/04-21/config_date_and_time_jpg_16967.jpg">
    <img width="200" height="230" align="right" src="/sites/shamce.net/files/resize/user_uploads/3-bigmack/article/node-30/2009/04-21/config_date_and_time_jpg_16967-200x230.jpg" alt="" />
</a>
</a>

The code that shows in the body field: (in any for, FCK enabled or not, and in source view for FCK)

<a href="http://shamce.net/sites/shamce.net/files/user_uploads/3-bigmack/article/node-30/2009/04-21/config_date_and_time_jpg_16967.jpg" target="_blank">
    <img width="200" height="230" align="right" src="http://shamce.net/sites/shamce.net/files/user_uploads/3-bigmack/article/node-30/2009/04-21/config_date_and_time_jpg_16967.jpg" alt="" />
</a>

Using firebug to edit the code to this makes the _blank work:

<a href="http://shamce.net/sites/shamce.net/files/user_uploads/3-bigmack/article/node-30/2009/04-21/config_date_and_time_jpg_16967.jpg">
    <img width="200" height="230" align="right" src="/sites/shamce.net/files/resize/user_uploads/3-bigmack/article/node-30/2009/04-21/config_date_and_time_jpg_16967-200x230.jpg" alt="" />
</a>

When in FCK, and i right click the image, i have options to edit image properties and to edit link properties. if i remove the link info in either one, the link data in the other disappears in the other and the link is properly shown, but without the ' target="_blank" ' . This seems like it might be an FCKissue but im not quite sure. It also seems like it could possibly be an image resize filter issue (but im betting FCK/wysiwyg).

So does any of this sound like the issue might actually be here or in fck? if it is there I will make the issue there. thanks

quicksketch’s picture

Status: Active » Closed (won't fix)

This feature won't be added to Image Resize Filter. Hopefully you've been able to figure out how to make a new window link based on the advice above, but that problem is general and not specific to Image Resize Filter at all.