Closed (fixed)
Project:
Juicebox HTML5 Responsive Image Galleries
Version:
7.x-1.2
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
26 Mar 2014 at 22:28 UTC
Updated:
22 Apr 2014 at 21:10 UTC
Jump to comment: Most recent
Comments
Comment #1
rjacobs commentedHi baxpace,
Yes, this is possible, but the details are certainly case specific. Adding the imageClickMode="OPEN_URL" config option is trivial (you just include it in the "pro / manual config" options for your gallery). Once you do this, the library will start opening up the linkURL value for each image when it's clicked, instead of navigating to the next image. This is all fine, as this module ensures that a linkURL value is set (it's typically just the full, unstyled, version of each image), but if you want to customize this value in any manual way some additional work is required.
Hopefully you are already familiar with the way this module allows you to specify the main image and thumbnail sources (this is pretty self-explanatory from the configuration). These settings determine how the Juicebox library imageURL and thumbURL values are set for each image. What is less obvious however (and a much less common need), is the process for changing the linkURL source value. This configuration for this is in the "Advanced" section of the gallery configuration options. Here you will find a picklist for the "LinkURL Source". If you are using the field formatter, there are really only 2 options (the styled or unstyled version of the image), but if you are using views then you can set this linkURL value based on any field.
So to do what you want to do, you'll probably need to be defining your galleries with views. For the basic structure I suggest having a look at the documentation. The only extra part for you will be that your content type (that's used in the view) will need an additional field to store your manually-set linkURL value. Once you have this, you can include the field in your view, and then select it for the "LinkURL Source" in your gallery configuration.
I hope that makes some sense....
Also, for reference, the feature that makes it possible to do this was added in #1975986: Add ability to allow linkUrl to be set via admin options.
Comment #2
baxpace commentedViews was going to be my next strategy if I couldn't assign the URLs right from a content type field somehow. Thanks so much for the detailed explanation!
Comment #3
rjacobs commentedYes, my gut reaction would be that views would be the best option. It's more complex, but it's also so much more flexible (in both general terms and in terms of integration with this module).
Technically you could alter the way the linkURL is populated with the field formatter as well, but currently it would requite getting into your own custom logic within a hook (hook_juicebox_gallery_alter). Also, you'd still need to have an image-by-image place to enter and store the custom URL values (which is not so easy just within the context of a single multi-valued field).
I also noticed you've marked that you are using 7.x-1.2. I's certainly suggest using 7.x-2.x at this point.
Comment #4
rjacobs commentedIt sounds like you have things under control, so I'll close this for now. If something new comes up feel-free to re-open or start a new issue.