Closed (works as designed)
Project:
Insert
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Nov 2012 at 05:57 UTC
Updated:
11 Jul 2017 at 20:06 UTC
Jump to comment: Most recent
Comments
Comment #1
davesommerhalder commentedAny ideas?
Comment #2
frankdesign commentedAnyone come up with a solution for this?
F
Comment #3
frankdesign commentedOK, I found a solution for anyone that stumbles on this page looking for an answer. This solution will open all inserted files in a new window.
In the Insert module folder, there is a folder called templates. Inside there is a file called insert-link.tpl.php. Copy that file to your templates folder in your theme folder. Then edit the copied file to add
target="_blank"directly after the text<a href="<?php print $url ?>"so you end up with<a href="<?php print $url ?>" target="_blank" <?php print $class ? ' class="' . $class . '"' : '' ?> title="__description__">__description_or_filename__</a>Now when you insert a PDF into the body text, the linked file will open in a new window.
Would be nice to have it as an option when inserting a file, but this workaround works perfectly for me on the site I am working on.
F
Comment #4
snater commentedI acknowledge this being an old issue and I deal with the Drupal 7 version occasionally only. Yet, I am not sure there should be an option for this as one should probably either open all files in a new window or all files in the same window. As demonstrated, altering the behaviour for all files can be done by altering the template. However, you should not edit the Insert module's native template, but rather overwrite the template with your own. To do that, you need to create a plain subtheme of your admin theme, install it and place your version of the insert template in the subtheme's templates folder.