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

bennos’s picture

Why colorbox?

Ctools can do it as well and it is more supported!?

rodrigoaguilera’s picture

Just because I don't know how to do it with ctools
¿ctools has lightbox effects?

bennos’s picture

One 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.

AlanO’s picture

Subscribed.

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.

Seph’s picture

Subscribe

victorcoder’s picture

Assigned: Unassigned » victorcoder

Ok, I don't understand what do you want exactly:

What's suppossed to be shown in the node body? A link? With what text?

rodrigoaguilera’s picture

I imagined it with the same link as a file field but when you click instead of download you get a colorbox/ctools modal

victorcoder’s picture

Status: Active » Fixed

Implemented in rc1

rodrigoaguilera’s picture

I tested it and works great.

Thanks!!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dbourrion’s picture

Hi
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

dbourrion’s picture

Issue summary: View changes

add code tags