It would be good to be able to set different behaviours at the end of slideshow loops:
* only run through once, and stop permanently at the last slide.
* set a different wait time for the last slide (ie. longer).
* re-direct to a different link.
These features would be especially useful for creating front-page splash-screen-like slideshows: create a custom sequence of nodes, and end on the front page, or re-direct to the front page, or quickly loop through some images, and end on a node where the user can choose where to go, then if the page is idle for too long, re-start the loop.
Comments
Comment #1
naught101 commentedI'm keen to have a go at this. I'm not averse to some php hacking. I'm not very familiar with javascript, but I can give it a go. I'm not sure where to start, really, and would like some pointers. If Views_Slideshow people want this feature, I'd be happy to provide a patch.
I'm thinking of storing 3 variables:
1. views_slideshow_last_behaviour - normal/stop/wait/wait then redirect.
2. views_slideshow_last_wait - wait time in milliseconds.
3. views_slideshow_last_url - url to redirect to.
I guess the logic in the javascript would then run:
Comment #2
hozt commentedIt would be good if you could set the number of cycles that the slideshow should display. This would be very useful when displayed on the homepage of a website where you want it only to cycle once.
If you are up to it do make a patch and if it works well hopefully it will get integrated into the next version!
Comment #3
naught101 commentedhozt: When you say "number of cycles", would the be any situation where you would use a specific number of cycles other than 1? I mean, I can't think of a reason for looping twice, or three times. I think "loop" and "don't loop" (and maybe then do something else) would be the only required options.
Comment #4
naught101 commentedHave a go at this beast. It works for me. Haven't tried many variations on the URL yet, and it'd be good to somehow use the baseURL for sites in a subdirectory, but I'm not sure how to do that.
patch is based on 6.x-1.x-beta2
Comment #5
code-brighton commentedThis worked a treat for me, just what I was looking for! Thanks good work naught101.
This should be incorporated in to the next release.
Comment #6
naught101 commentedNote, that I think there's a minor error: the Wait time is currently set to loop time+wait time, when it should just be wait time (I think). In otherwords,if you use "wait", the last slide waits for (2*looptime)+waittime.
remove "slideshow_data[slideshow_main]._timer_delay + " from the first else if to fix.
Comment #7
redndahead commentedNaught101: Can you reroll this using 6.x-2.x-dev. Also change the spellings to American English spellings. So behaviour would be behavior, etc.
Comment #8
redndahead commentedBumping version
Comment #9
Poieo commentedAny chance of a patch for 2.x?
This is a great addition...
Comment #10
naught101 commentedhrm... wtf happened to js/views_slideshow.js ? this might take a bit..
Comment #11
naught101 commentedOk, I'm getting there slowly... just looking at http://malsup.com/jquery/cycle/options.html , I see that there's already an auto-stop option in the cycle plugin, however there's no options for a delay on the last slide (only on the first), and there's no option for a redirect after the last slide.
I'm wondering if this should now become a feature request for the jQuery Cycle Plugin? I can imagine there might be a few situations outside of drupal where these features might be useful. Or does it make sense to get this working in drupal, and then push it back up into the Cycle plugin?
Comment #12
naught101 commentedhttp://github.com/malsup/cycle/issues/#issue/5
Will wait and see...
Comment #13
naught101 commentedHuh.. ok, this is basically already implemented in the Cycle plugin, using the
timeoutFnfunction to create a manual set of timeouts for the slideshow, and then using custom javascript in theendfunction withautostopto redirect the browser elsewhere.I'll see what I can do...
Comment #14
naught101 commentedOk, done, and much easier this time. The code definitely needs review - I'm not sure whether the functions are in the right place in the js file, I'm not familiar with drupal JS coding style (if there is one).
should apply cleanly against the latest 2.x dev release
Comment #15
redndahead commentedJust a quick look. American english spellings still. behaviour -> behavior. Don't know when I can fully test. Thanks for keeping up.
Comment #16
naught101 commentedSince there hasn't been a new dev release since the patch, this should still work. Spelling changed to aAmerican.
Comment #17
redndahead commentedIt's looking pretty good. I like this change a whole lot.
Here are some changes. Have a look here for drupals coding standards: http://drupal.org/coding-standards
Here you can see you are only using one space to indent the timeouts below the if.
Here you have a 4 space indent.
Let's change this to replay instead of normal
Let's change Normal here too, to Replay
Let's change this line to:
Powered by Dreditor.
Comment #18
naught101 commentedOk, will re-do that stuff. Perhaps "Loop" would be better than "Replay"? That's the standard terminology in audio and video editing, and I've seen at least a few slideshow applications that use it...
Comment #19
redndahead commentedI asked on #drupal and people seemed to like replay. Loop seems technical to me and if possible I'd like to stay away from technical terms as much as possible. Thanks
Comment #20
naught101 commentedOk, I'll disagree, but not dissent on that one :)
Your suggestions applied, and more indenting fixed
Comment #21
squarecandy commentedsubscribe.
Comment #22
pomliane commentedPatch fails here :
patch: **** malformed patch at line 102: + );New version attached.
Comment #23
shane birley commentedDoes this also provide a way to hide the "next" and "previous" menu items in the pager when the slideshow is on the first and last slides? I assume this would happen if the cycle is set to stop at the last slide, etc. (re: nowrap: 0 and then hide the link / reappear when not on last slide, etc)
Comment #24
redndahead commentedI'm going to take this one a little slow. This first patch adds the ability to choose if the slideshow starts over on the last slide or stops. Please review and tell me if you have any problems.
Comment #25
redndahead commentedThe patch in #24 is committed. I will open up a new issue for the other ones, but postpone it to a future release.
Comment #26
redndahead commentedHere is the new issue #773624: Add additional end of loop options