This patch is an attempt to improve the Colorbox configuration and formatter settings.

1. Move gallery options to the formatter settings so they can be set per field. Added a "custom" option as well.
2. Add caption options to the formatter settings so they can be set per field.
3. Add "Hide" to the Node image style options so images can be part of a gallery but hidden on the page.
4. Add configuration for plugin settings "initialWidth" and "initialHeight".
5. Add configuration for plugin setting "Fixed" and make it true be default (the plugin default is false).

I have marked several issues as duplicate of this since this patch tries to solve the problems in these issues.

Please test the patch and report back here how it works for you.

This I would like to get answers on:

* Is the new formatter settings easy to use and is the help text helpful?
* Does this make it easy to have a "Single Thumbnail That Opens a Colorbox Slideshow"?
* Is it a good choice to make "Fixed" default to true? The plugin itself default to false but I like the fixed behaviour better.

In a second step I would like to make it possible to have any textfield set as caption. Just need to find a good way to do it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Pasqualle’s picture

Where is the patch?

frjo’s picture

Here it is. Thanks for alerting me to the fact that I managed to forget to upload the patch itself!

kevinquillen’s picture

I've applied the patch, but all of the images are still output on the page. I am confused. Which one of the settings will just show the first image of a multiple imagefield on a node, but still open a colorbox gallery?

I applied the patch against the stable 7 branch- I will try the dev build + patch next.

frjo’s picture

@Kevin Quillen, Thanks for testing the patch!

You can only hide all images in a field. So to get the functionality you are looking for you need two image fields. I might take a stab at adding the possibility to hide all images but the first but it's a bit more complicated.

Select "Hide" in the Node image style options for the field in question. You then add a second imagefield to hold the "trigger" image you want to display to your visitors. Make sure the two fields have the same gallery value and it should work.

kevinquillen’s picture

Hmm. I just want to have a single imagefield with multiple values - there must be some way to do this with preprocess function to 'hide' all photos except the first one, and still get Colorbox usage out of it.

Is there a function I can call to add a css class to each photo?

frjo’s picture

Status: Needs review » Fixed

Committed patch to 7-dev.

kevinquillen’s picture

Not really the solution I was going for, but this is the only thing that would work for me.

div.field-name-field-photo div.field-items div.field-item {
  display: none;
}

div.field-name-field-photo div.field-items div:first-child {
  display: block;
}

Status: Fixed » Closed (fixed)

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

atiba’s picture

Status: Closed (fixed) » Active
FileSize
63.14 KB

* Does this make it easy to have a "Single Thumbnail That Opens a Colorbox Slideshow"?

I want to actually achieve this but without luck so far.
I tried the steps mentioned above but Colorbox just doesn't seem to group my images.

Can Views be the issue? The page with the 'single thumbnail' is created with Views and so are its fields.

And does the "Per field per post gallery" still needs a 'rel' target?
And what do you mean with "Make sure the two fields have the same gallery value and it should work."? How do I set them up?

With this post I included a screenshot with my field (Colorbox) settings of the node.
Field 'Screenshot' is visible on the website and is the thumbnail.
Field 'Gallery' is Hidden and has the option to upload 3 images.

I hope you can help me out. I like Colorbox, so I hope my problem isn't that difficult because I know it is possible. Thanks.

frjo’s picture

Status: Active » Closed (fixed)

Please don't reopen old post, post a new issues instead.

frjo’s picture

Issue summary: View changes

Spelling fixes.