I need functionality similar to that in Google Picasa:
1) I have a gallery (grid view) with image thumbnails.
2) I need to have a separate link (somewhere above the gallery) that will start a slideshow with all images on the page.

The slideshow field formatter provided in the views will start a slideshow when I click on one of the images but I also need to start the slideshow from clicking on a a non-image object, or even better from typing a direct URL in the browser.

How can I do that?
Thanks!

Comments

stella’s picture

Status: Active » Fixed

To create a gallery (grid view) check out CCK + imagefield + Views. Also check out imagefield_gallery, but not sure there's a stable D6 version of that yet. There's also other ones that might do what you want, such as brilliant gallery, image+image gallery, etc.

Depending on how you implement the gallery grid will affect how you start the slideshow. If using imagefield, then you just need to choose one of the "Lightbox2 slideshow" options from the "Display fields" settings for that CCK imagefield. If using imagefield_gallery, then I think it's done as part of the imagefield gallery configuration page. If using image + image_gallery, or brilliant gallery, etc, then choose the "slideshow" setting on admin/settings/lightbox2/automatic where appropriate.

For the link above the image grid, use html something like the following:

<a href="/path/to/first/image/in/gallery.jpg" rel="lightshow[group_name]">Click me!</a>

You will need to set the group_name to the same group name as is generated for the image links themselves. The best way to do this is to set up your image grid with the slideshow functionality, look at the page source and find the group name used and use that.

Cheers,
Stella

kirilius’s picture

Thanks, I actually know how to make a gallery using CCK+imagefield+Views. That is not a problem and setting the LB2 slideshow field formatter also works fine. My problem is that I want to create this "Start Slideshow" link above the gallery.
Reading the documentation I figured that the code for that link should look like:

  <a href="#" rel="lightshow[some grouping, which I can easily find from the page source]">Start a slideshow</a>

What you are suggesting is to also put the path to the first image from the view as the value for the href attribute. But since this is a view, therefore completely dynamic, there is no way I can know that. That's my whole problem. I need a function call that will start the slideshow and LB2 will then scan the page for the lightshow formatters and display the appropriate pictures. I mean why does it always have to be an image that starts the slideshow?

Even better I would ask if it is possible to compose an URL that when opened will automatically start a LB2 slideshow with the images on the page?

If you look at an example: http://picasaweb.google.bg/kiril.rusev/Pirin2008 (one of my galleries in Picasa), there are the thumbnails and there is a button "Slideshow" on top of the page. It could be a button, a link or anything else. I just need a way to tell LB2: "scan the pictures on the page (if that's what it does) and give me a slideshow".
Even better if you click on the link here: http://picasaweb.google.bg/kiril.rusev/Pirin2008#slideshow , you will have the slideshow immediately start for you.

That's the kind of functionality I am looking for and again - I don't know the path to the first view image.

Thanks again for the quick reply!

stella’s picture

Status: Fixed » Active

Ah, ok. I need to think about how that can be done.

kirilius’s picture

Thanks!

kirilius’s picture

I played a little with the href attribute of my desired link. If I do something like href="javascript:Location.start()", I get the LB layer show up, but it is empty.

May be if you give me a short overview of how LB works (what functions are invoked when user clicks on a link, sequencing, workflow, etc.), I will be able to think of a solution myself.

kirilius’s picture

Just checking if anyone has an idea how to solve this problem?

stella’s picture

Category: support » feature
Status: Active » Fixed

I've added this feature to CVS and it will be included in the next dev version of the module, available later today.

To do it, you will need to create in link on the page something like the following:

<a href="#" onclick="Lightbox.triggerLightbox('lightshow', 'groupname');">Start Slideshow</a>

The first param to triggerLightbox() should be one of 'lightbox', 'lightshow', 'lightframe', 'lightmodal' and 'lightmodal'. The second param is optional and should be the name of the rel grouping in use. If the rel attribute setting is handled automatically for you, e.g. by CCK display option or settings on admin/settings/lightbox2/automatic, then you will need to look at the page source to determine the rel group in use. See http://drupal.org/node/144488 for details on the formatting of the 'rel' attribute. Note, you just need to enter in the rel group name, not the entire rel attribute value.

For Views, the rel grouping is determined partially by your settings under the "CCK display settings" section on admin/settings/lightbox2. For example, if you configure lightbox2 to group imagefields by just their field name and your imagefield has a machine-readable name of "field_testimage", then you should call Lightbox.triggerLightbox('lightshow', 'field_testimage');.

Note, if you're entering this link with an onclick attribute, you will need to use the "Full HTML" input format. For security reasons, it is recommended that you don't allow untrusted users on your site access to this input format.

Cheers,
Stella

kirilius’s picture

Thanks a lot for this! I will give it a try.

Happy New Year!

stella’s picture

The updated dev release isn't available yet, so you'll need to get it from CVS if you want it now (tag: DRUPAL-6--1).

stella’s picture

Released in Lightbox2 6.x-1.9 and 5.x-2.9.

Cheers,
Stella

Status: Fixed » Closed (fixed)

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

rsbecker’s picture

This fix works if you are on the node containing the slideshow. But if you promote the node to the front page the link breaks. How do you fix it?

Thanks