Closed (fixed)
Project:
PDF Reader
Version:
7.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
27 Aug 2011 at 15:25 UTC
Updated:
24 Sep 2012 at 14:42 UTC
I use a similar feature on my site but with some jquery code
(function($) {
Drupal.behaviors.googlebox = {
attach: function (context) {
var link = $('.field-name-field-pdf a:first');
var href = link[0].href;
link.colorbox({html:'<h1><a href="'+href+'">download pdf</a></h1><iframe src="http://docs.google.com/viewer?url='+escape(href)+'&embedded=true" width="99%" height="88%" style="border:0;"></iframe>',width:'80%', height:'90%'});
}
};
when someone clicks on a pdf file this opens a colorbox with 2 things
-a link to download the actual pdf
-a iframe with the google docs reader
and degrades gracefully
hope you can integrate this somehow in your module
Thanks for your work
PS: I can't get the zoho viewer to work, it loads the code
Comments
Comment #1
bennos commentedWhy colorbox?
Ctools can do it as well and it is more supported!?
Comment #2
rodrigoaguileraJust because I don't know how to do it with ctools
¿ctools has lightbox effects?
Comment #3
bennos commentedOne easy way could be
http://drupal.org/project/ctools_automodal
only 5 lines of code.
Opens the form via drupal_get_form in a ctools frame.
Comment #4
AlanO commentedSubscribed.
I would like the same thing. I also don't know how to do it with Ctools cause I'm a total newbie with php code and hooks. CTools Auto-modal looks like greek to me.
Comment #5
Seph commentedSubscribe
Comment #6
victorcoder commentedOk, I don't understand what do you want exactly:
What's suppossed to be shown in the node body? A link? With what text?
Comment #7
rodrigoaguileraI imagined it with the same link as a file field but when you click instead of download you get a colorbox/ctools modal
Comment #8
victorcoder commentedImplemented in rc1
Comment #9
rodrigoaguileraI tested it and works great.
Thanks!!
Comment #11
dbourrion commentedHi
Trying the Colobox thing, got the link but clicking on it, got "This content failed to load" into the colorbox windows
Any help ?
Thanks
Best
Comment #11.0
dbourrion commentedadd code tags