Please open the pdf in a new navigator window

jordipujol - January 24, 2007 - 17:53
Project:Pdfview
Version:5.x-1.x-dev
Component:User interface
Category:feature request
Priority:minor
Assigned:Unassigned
Status:reviewed & tested by the community
Description

for the average user, is more friendly open the pdf in a new navigator window. I include the code that does so.

added target=_blank,

******* code ****************************
/**
* Theme a Pdfview link
* @ingroup themeable
*/
function theme_pdfview_link($node) {
if ((user_access('access content as PDF') || user_access('administer nodes'))
&& variable_get('pdfview_'.$node->type, 1) == 1) {
$attributes = array("title" => t('Display a PDF version of this
page.'),"target" => t('_blank'));
$links = l(t('download PDF'), "node/$node->nid/pdf", $attributes);
}
return $links;
}
******* code end l****************************

#1

Egon Bianchet - February 27, 2007 - 09:53
Status:active» by design

It's up to the user to set up his browser to do that

#2

rconstantine - October 17, 2007 - 21:03
Version:4.7.x-1.x-dev» 5.x-1.x-dev
Status:by design» reviewed & tested by the community

What do you mean it's up to the user to set his browser to do it? It's fairly customary when moving away from an HTML page to something else to open it in another window or tab, just as the code above suggests. This is a good addition and works.

#3

falconerc - December 5, 2008 - 19:45
Priority:normal» minor

While yes, you can use a setting to open windows in a new tab / window in the preferences in most browsers, what is being talked about here is instead of navigating away from the page where the .pdf document is referenced, it will automagically open a new tab in which the .pdf document is displayed, thereby keeping the original page up for the user to see.

#4

doualiya - January 28, 2009 - 16:14

Where do I have to put this code ?
Thanks

 
 

Drupal is a registered trademark of Dries Buytaert.