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.

CommentFileSizeAuthor
#1 juicebox_node_gallery_item_views.txt7.09 KBrjacobs
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rjacobs’s picture

Title: Bundle support for node gallery » Document support for node gallery
Component: Code » Documentation
FileSize
7.09 KB

After 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:

  1. Go to /admin/structure/views and click on the "Import" option.
  2. Copy-and-paste the full (raw) text inside the attached txt file into the "Paste view code here" box (leave all other import options blank) and click "Import".
  3. When the imported view loads, simple save it.
  4. Now we need to tell Node Gallery to use this view when displaying galleries. For this go to /admin/config/content/node-gallery and click the "Change settings" link for the Gallery Relationship that you want to change (there may only be one). In the resulting settings screen change the "Full Content" view setting to be "Juicebox Node Gallery" and click save.

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.

rjacobs’s picture

Status: Active » Fixed

This is now documented in the module's views style plugin notes (https://drupal.org/node/2164865) with a link here.

Status: Fixed » Closed (fixed)

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

philmck’s picture

This (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.

Rogerev’s picture

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

chris-adhome’s picture

@rjacobs

Works for fine for the first gallery you create but not the subsequent galleries.. can you confirm?

chris-adhome’s picture

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

rjacobs’s picture

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