I know this has been asked here before. But no issues yet for the 7.x branch.

I've read the docs, searched the issuequeue, but can't get this to work.

Content type = "Documents"
I've got a field in there of type "file"
I create a new node of type "Documents".
I upload a PDF file the file field.
Filefield gets displayed as "generic file" :

<a title="This is a pdf file - supposed to open in Lightbox" type="application/pdf; length=69409" href="http://www.domain.com/path/to/ConsumerSelector_NL.pdf" rel="lightframe[|width:1100px; height:700px;]" class="lightbox-processed">Click here for PDF Lightbox magic ... not really :/</a>

Note: The class="lightbox-processed" and rel="lightframe[|width:1100px; height:700px;]" are both injected by the jQuery hereunder :

/* Trigger Lightbox on PDF links */
Drupal.behaviors.triggerLightbox = {
attach: function(context, settings) {
$("a[href$='.pdf']").attr("rel", "lightframe[|width:1100px; height:700px;]");
return true;

What happens is this:
- an empty lightbox is opened (with specified sizes) - pdf is not loaded inside
- the browsers throws 2 (!) open/save this file dialog boxes at the user ...

Anyone can shed any light on this issue ? thanx


jebernier’s picture

Are you just trying to simply open a PDF?

If so, use:

rel="lightframe[|width:___px; height:___px;]" target="_self" title="Title for PDF"

sunchaser’s picture

thanx jebernier
that was indeed the correct syntax.

I needed a more elaborate test to see what was really wrong in my case tho:
Seemed my server treated PDF's in a weird way ... cause when I linked to a pdf on a different server your syntax seemed to work perfectly ... just not pdf's on the server where the Drupal install was living.

Problem solved ... (from the Drupal point of view) ... still need to figure out which serversetting I need to change to be able to correct this issue. Will report back here if I find it.