I am trying to use the Colorbox Load functionality to render a node page. On this node page I have attempted to add a slideshow using views_slideshow and views_embed_view() via the preprocess_page() function. I have added the "colorbox-load" class to the link and colorbox is initializing and rendering the popup correctly. However, my slideshow never gets initialized because the $scripts variable is empty and/or doesn't render in the colorbox popup. I was under the impression that colorbox rendered in an iframe, which should support rendering JS in the head, but inspection of the source implies it uses ajax?

Obviously I'm not familiar with the inner working of Colorbox ;)

I have successfully implemented slideshows on other pages using views_embed_view() for numerous sites, so I know that without adding Colorbox to the equation, this is possible. Do you have and ideas or suggestions on how to get this to work? Or whether I should expect JS to be processed by Colorbox at all?

The functionality in question is being prototypted here: http://pickapart.aaroncarlton.net/builder_vehicles - hopefully you don't catch me in development.

Thanks in advance for considering the support request.

Comments

frjo’s picture

You can set width, height and iframe in the query "[path]?width=500&height=500&iframe=true".

Have you checked out the Views Colorbox custom field handler? It's very flexibel.

Another option is to add a custom js file that looks mush like colorbox_load.js but that set iframe to true by default.

aaron.r.carlton’s picture

Adding the url parameters solved the issue. I remember seeing the query string params in other colorbox documentation, but hadn't experimented with them and forgot until you mentioned it. Thanks!

I have played around with the Colorbox: Trigger field for Views if that's what you mean, but it wasn't immediately apparent how to use it. Are you supposed to add fields to your view, exclude them from the display and then use Colorbox: Trigger to associate to them and provide the link? Some pointers or more explicit documentation in the README.txt would be extremely helpful - I don't even see it mentioned in the feature list.

Thanks so much for your assistance! I'll leave it to you to close the ticket :)

frjo’s picture

Status: Active » Fixed

Yes, the Colorbox trigger field for Views does need some documentation.

You have the basics right on how to use it. It's a bit complex but also very flexible. You can read a bit more here http://drupal.org/node/799216

Status: Fixed » Closed (fixed)

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