Hey, guys!
I couldn't find any way to set lightbox iframe height and width in percents ( and it wasn't implemented in previous versions either), also I failed when trying to use width and height options like rel="lightframe[|width:100px; height: 100px;]".
That's why i wrote my own patch, that makes an additional setting item in settings form for lightbox2.
Just go to 'Congifuration -> Lightbox2 -> Advanced settings' and you will see an 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.
I'm not sure it's the best way to get it done, of course the better way is to set this in attributes, but it seems to be very weighty task that i can't handle right now.
Anyway, maybe this patch will push somebody to implement it in a future releases of lightbox.
THANKS!
Comment | File | Size | Author |
---|---|---|---|
#8 | iframe-width-height-precent-1287270-8.patch | 4.19 KB | florisg |
#7 | lightbox2-7.x-2x-iframe-1287270-07.patch | 4.76 KB | voleger |
Comments
Comment #1
kruser CreditAttribution: kruser commentedPatched worked for me. Thanks.
Comment #2
Vinay Punyamurthy CreditAttribution: Vinay Punyamurthy commentedHi barbun,
This is a great idea, I've been trying this from quite sometime but was not able to achieve this!
I followed all the steps mentioned to apply the patch for my version 7.x-1.0-beta1.
I'm able to get iframe settings fieldset in the admin configuration page, but it does not have the fields to input height and width! May be there's something more I need to do to fix the issue?
can you help me fix this issue?
Thanks in advance.
Comment #3
kitikonti CreditAttribution: kitikonti commentedPatch works fine, nice work.
Comment #4
HansKuiters CreditAttribution: HansKuiters commentedWorks fine for me.
Comment #5
pifagorLook good
Comment #6
alex_optim+1
Comment #7
volegerRerolled.
I can't push it as is. It will change the default behavior of iframe settings. We should make this feature optional to safe BC.
Comment #8
florisg CreditAttribution: florisg at 040lab commentedrerolled against latest git: a91a9e8a