Closed (fixed)
Project:
Colorbox
Version:
7.x-2.4
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 May 2013 at 14:32 UTC
Updated:
2 Jul 2013 at 14:10 UTC
Love the module. My use case is to take programatically take the result of a view and load it into a colorbox. I can use views_get_view or views_embed_view to get a result array or a large html string. But how can I pass that to the colorbox?
Your help is greatly appreciated.
Comments
Comment #1
sam152 commentedPut your view into a div with a _wrapper_ that is hidden (ie, display:none;). Then you can use the following javascript:
You must replace the 'href' attribute with the appropriate jQuery collection representing your view. Other customisations to the way your colorbox appears can be found on the colorbox website.
If you need some advice on placing a view on your page, here is a clean implementation:
In this case your selector for colorbox would be `#my-view-container .view`.
Source.
Comment #2
drtrueblue commentedFantastic! Thank you so much. Prior to reading #1, I was able to use the inline approach successfully, however, I relied on a far uglier approach to getting the view on the page. The function was extremely valuable.
Comment #2.0
drtrueblue commentedadding views_embed_view as a possible function that can offer context to a possible solution