Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How can I use "open a File in new window" in drupal 7?
How can I use "open a File in new window" in drupal 7?
Comments
Comment #1
Devin Carlson CreditAttribution: Devin Carlson commentedAdd
target="_blank"
to the link.Example:
<a href="/sites/default/files/file_name.pdf" target="_blank">File</a>
.See the HTML Anchor Element page on the Mozilla Developer Network for more details.
Comment #2
rogical CreditAttribution: rogical commentedjust confused when display an image and set 'Link image to' file, how can I add 'target="_blank"'?
hack theme is not a good way, there should be a good way to end users for UX.