Hi,
I'm the maintainer of Field Slideshow, and one of the options is to open images in Colorbox.
Everything is working fine, but I'm trying to add an option to start the slideshow in Colorbox when an image is opened in Colorbox.
For now, links look like this:
<a href="/sites/default/files/japart.png" class="colorbox" rel="field-slideshow[2]">
so perhaps it should be somethink like:
<a href="/sites/default/files/japart.png?slideshow=true" class="colorbox" rel="field-slideshow[2]">

Tell me.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frjo’s picture

There is settings for it on Configuration -> Colorbox. See under Styles and options -> Custom -> Slideshow settings. The settings makes this however a global option, not what you are looking for perhaps.

The attached patch make the colorbox-load feature accepts any Colorbox settings as url queries. You can see all the options at http://colorpowered.com/colorbox/.

Could you test the patch and see how it works for you? It's against the latest 7-dev code?

A link could look like this:

<a class="colorbox-load" rel="something" href="some/path?slideshow=true&slideshowAuto=true&slideshowSpeed=2500">Something</a>

The class would need to change from "colorbox" to "colorbox-load". You would also need to enable Colorbox load in the Colorbox configurations.

My tips is that you run "variable_set('colorbox_load', 1)" in your module when users select to use the Colorbox function.

frjo’s picture

Field Slideshow is a quite neat module! Believe I will use it on one of my current projects, thanks for developing it!

jdanthinne’s picture

Thanks, and thanks again for the patch, I'll have a try this week-end.

frjo’s picture

Status: Active » Fixed

Committed patch #1 to 7-dev.

jdanthinne’s picture

Many Thanks.
Updated my module to use that, and it's working fine!

jdanthinne’s picture

Status: Fixed » Active

Mmm.
Just added an option in my module to choose between auto or manual slideshow, but it's not working.
If I choose Auto (and then adds &slideshowAuto=true), it's ok, but Manual (&slideshowAuto=false) goes automatic as well…
What's wrong?

frjo’s picture

Status: Active » Needs review
FileSize
801 bytes

Do you happen to have more than one colorbox-load link on the page? I have found a bug in my #1 patch. The bug make all settings the same as for the last link on the page. Sloppy testing by me.

Here are a patch that I believe will fix this bug.

Would be glad if you could test it.

jdanthinne’s picture

I've tested that with multiple links on the page, and it seems ok.
But #6 bug is still there… but I don't know if it's your module that's faulty or Colorbox itself…

frjo’s picture

Another bug you found, thank you! It it wasn't so lame I would blame the hot climate I'm in at the moment ;-).

"false" (string) is not the same thing as false (bool).

This patch adds code that makes sure true/false values are sent to the Colorbox modules as bool.

frjo’s picture

Status: Needs review » Active

Committed patch #9 to 7-dev.

frjo’s picture

Title: Link argument to start slideshow » Allow all Colorbox plugin settings to be controlled via url queries

Better title.

frjo’s picture

Category: support » bug
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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