This idea of node gallery integration has come up a couple time in the past, such as #1985630: Making Juicebox work with the Field Collection module and the Node Gallery module and #1976616: Views recipies: Configure View for multiple albums, contextual filters, etc.. The more I think about it, the more I like the idea of having some basic support officially bundled into the module for it.
It's common for "site-building" questions to pop-up in the issue queues (support requests regarding how to use views, etc.), and it would be nice to be able to handle those without getting into concepts that are beyond the scope of this module. Ultimately the main purpose of this module is to be a robust display formatter that does not make too many assumptions about what image-management architecture is used. However, it's clear that some users, who like the Juicebox javascript, are not fully comfortable constructing an overall image-management solution. For these people I'm thinking that node gallery may be a great recommendation. I'm not personally for-or-against the concepts that node gallery uses, but I think it's provides a nice simple out-of-the-box architecture to work with.
From what I can see, swapping out a display formatter within a node gallery may be as simple as defining a new view that users can select to override the default "grid" view that node gallery uses. Bundling such a view into Juicebox, along with some instructions about how to activate it, may be fairly straightforward. This is especially true now that the 2.x branch of Juicebox has support for file fields (not just image fields) within views.
Comment | File | Size | Author |
---|---|---|---|
#1 | juicebox_node_gallery_item_views.txt | 7.09 KB | rjacobs |
Comments
Comment #1
rjacobs CreditAttribution: rjacobs commentedAfter giving this a bit of thought I think I'd rather treat this as a documentation task instead of bundling any code changes within the Juicebox module itself. All we need to support Node Gallery is a properly formatted view, and even though such a view could be bundled directly into the Juicebox module, I think it will be best to just make a version of it downloadable here (which can be imported into any site).
I've created/exported a view that seems to work and attached it. For anyone interested in using this special view, and making node galleries appear with Juicebox, you will just need to do the following:
That should be it. After completing these steps your Node Galleries should render with Juicebox. Note that you can of course further tweak the specific Juicebox settings (colors, etc.) to your liking within the new view at /admin/structure/views/view/juicebox_node_gallery_item_views/edit
I hope this helps someone. Comments are welcome. I'll also try to get these notes into the official module documentation soon.
Comment #2
rjacobs CreditAttribution: rjacobs commentedThis is now documented in the module's views style plugin notes (https://drupal.org/node/2164865) with a link here.
Comment #4
philmck CreditAttribution: philmck commentedThis (and node gallery) saved me a lot of messing about with the infinite permutations of settings that are Drupal, and effectively gives me "swipe" support on a mobile view. Many thanks! It would be great to get it to work with videos as well someday.
Comment #5
Rogerev CreditAttribution: Rogerev commentedAs per previous comment, as a relative newbie to Drupal, this provides a nice solution for me as it combines the easy mass upload of images that the node gallery allows (with pupload) and the more sophisticated look and feel of the Juicebox display for images.
Thank you for posting this text and associated instructions.
Comment #6
chris-adhome CreditAttribution: chris-adhome commented@rjacobs
Works for fine for the first gallery you create but not the subsequent galleries.. can you confirm?
Comment #7
chris-adhome CreditAttribution: chris-adhome commentedOkay so I figured out my Issue (#6), when you are setting your Configuration -> Authoring Content -> Node Gallery -> Change Content Type settings, make sure you set them to what you want before you create & upload images to your Node Galleries.
It would appear playing with the Content Type settings can mess up both Node Gallery and JuiceBox's ability to display images. Took me a little while to figure out this was causing my issues.
Comment #8
rjacobs CreditAttribution: rjacobs commentedI have not looked at Node Gallery for a while, and I don't currently have access to the instance I previously used to test it. The only integration point with Juicebox is the view configuration used to display the final gallery, as all the other mechanics are handled by Node Gallery and core Drupal fields. It could be that Node Gallery's configuration is node-specific (and initialized from a some global settings when the node is created). If so, then retroactively applying settings to previous Node Gallery content may require a special process. I'm just speculating with all this though. It might be worth opening a support request in the Node Gallery queue regarding the ways Node Gallery content type configuration (/admin/config/content/node-gallery) is handled.