Closed (fixed)
Project:
Lightbox2
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Nov 2008 at 18:26 UTC
Updated:
12 Jun 2009 at 17:41 UTC
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
Comment #1
stella commentedTo 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:
You will need to set the
group_nameto 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
Comment #2
kirilius commentedThanks, 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:
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!
Comment #3
stella commentedAh, ok. I need to think about how that can be done.
Comment #4
kirilius commentedThanks!
Comment #5
kirilius commentedI 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.
Comment #6
kirilius commentedJust checking if anyone has an idea how to solve this problem?
Comment #7
stella commentedI'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:
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 therelgrouping 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
onclickattribute, 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
Comment #8
kirilius commentedThanks a lot for this! I will give it a try.
Happy New Year!
Comment #9
stella commentedThe 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).
Comment #10
stella commentedReleased in Lightbox2 6.x-1.9 and 5.x-2.9.
Cheers,
Stella
Comment #12
rsbecker commentedThis 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