Hi there Stella, I've been playing with displaying node content in iFrames with Lightbox2 and having good success with it so far. I came across a problem which I'd like to discuss with you in regards to pixel widths and height. My iFrame page template uses a liquid width and can handle variable sized lightboxes so I decided it would look much nicer if I could tell lightbox to display the iFrame in a box almost as large as the browser window, say 80% of its size.

I've hacked the lightbox.js file to make this work but its a quick and dirty hack rather than something someone should use, just a proof of concept. I used the lightbox function Lightbox.getPageSize() to get the page width and height and then simply made a percentage of that apply when resizing iframe content. I've attached a diff so you can see what I mean.

What may be cool is to be able to specify a percentage or pixel width in the lightbox admin page for 'HTML Content' and have lightbox use the Lightbox.getPageSize() function if it detects the user has entered a % sign. Or something along those lines...

CommentFileSizeAuthor
#12 lightbox2-7.x-iframe.patch9.63 KBbarbun
lightbox-iframe.diff1.54 KBtanc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stella’s picture

Status: Active » Postponed

I like the idea, but marking as postponed until after next release.

filburt’s picture

Assigned: Unassigned » filburt

Hi Stella,

is there any progress of including this functionality? I'm very interested, too. I've seen that it is not included in the latest release, yet.

Thanks and greetings
Filburt

big_smile’s picture

Is this patch safe to use on a production site?

jglynn’s picture

This would be a great feature to have.

big_smile’s picture

I am trying to apply the patch to the 6.x-1.x-dev version of Lightbox, but I'm not having any luck.

I am following the message on this page (using Max OSX Terminal) but I just get the message

patch unexpectedly ends in middle of line
patch: **** Only garbage was found in the patch input.

Does anyone have any pointers? Or better yet, the final patched lightbox.js file?

Thanks.

buzzman’s picture

any progress from anyone on this? bump

theshanergy’s picture

subscribe

jglynn’s picture

bump

eme’s picture

subscribing

AntiNSA’s picture

subscribe

eme’s picture

Status: Postponed » Needs work

Seems it is a real feature request. Marking as "need work" on the currently available patch.

barbun’s picture

FileSize
9.63 KB

Hey, guys!
I fixed this problem, but for D7.
My patch makes additional setting item in settings form for lightbox2.
Just go to 'Congifuration -> Lightbox2 -> Advanced settings' and you will see additional item called "iFrame settings". There are two fields inside (height and weight), where you can put your own values in percents and it will affect on eventual iframe size.

Hope it will help somebody)

yukare’s picture

Please, something is wrong with your patch. If it is for drupal 7, create a new issue for it and add this patch for this, let us keep this for drupal 6, and the patch must be make using last dev, because your patch removes about anything in function lightbox2_field_formatter_info() and other recent changes i done, so i think it is for drupal 7, but is not using the last version of git.

When you create a new issue for drupal 7, please, post the link here, and if we get a working patch for drupal 7, we can backport it to drupal 6 and commit it.

barbun’s picture

You are wright, that patch is for D7 only. Sorry that posted it here, i thought it might help people who are in seaching for the solution.
I made an issue in 7.x branch, here the link:
http://drupal.org/node/1287270

Thanks