Closed (fixed)
Project:
Drupal core
Version:
8.8.x-dev
Component:
file system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
31 Oct 2012 at 12:03 UTC
Updated:
11 Aug 2020 at 13:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirThis is not a critical task.
Comment #2
mahi.orai commentedthen tell me how to open a attachment in new window
Comment #3
mahi.orai commentedthen tell me how to open a attachment in new window
Comment #4
monish_deb commentedAlthough it works in content edit page where clicking on attachment opens it in new window, but not so in case of view.
Comment #5
CowTownFarmBoy commentedHave you checked the permissions?
Comment #6
monish_deb commentedThere are two ways to implement the changes for attached file in content view by adding the below code before return in file/file.module(function theme_file_link() ) :
1) To open file in new tab
$options['attributes']['target'] = '_blank';2)To open file in new window
Comment #7
mahi.orai commentedwhere we write this code.
Comment #8
monish_deb commentedAdd the above code under Drupal Core module Path:"[Your Drupal directory]/modules/file/file.module" at Line : 746, function:theme_file_link() before "return".
Comment #9
dddave commentedComment #11
Anonymous (not verified) commentedJust wanted to add a thank you to monish_deb for the answer to this post. Helped me out today.
Comment #12
shraddha404 commentedHello
Thank You monish_deb for the solution.
You saved my days.
Shraddha
Carving IT Pvt. Ltd.
Comment #13
parvateesam commentedwill have to add patch for drupal 8.8.x as well. This is not working drupal 8 as well.
Comment #14
parvateesam commentedAdding patch for 8.8.x