Hello,
I recently received a request to have the timeout of each slideshow slide customizable. I know you can do this by using the timeoutFn advanced option and a bit of jQuery magic, but I thought it might be a nice feature for Views Slideshow Cycle so I patched it. The patch provides the following:
- A new option on the slideshow settings page to choose a timeout "mode". (static or dynamic)
- If 'static' is chosen (which is default) the regular timeout field is visible
- If 'dynamic' is chosen, a set of radio buttons is shown that let's the user choose which field contains the timeout value. (The field must be a part of the view)
The patch is against 7.x-3.x (2012-Mar-26)
Let me know what you think!
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#8 | 2013-views_slideshow-setting-default-time-dynamic-timeout.jpg | 223.66 KB | GreenSkunk |
#2 | views_slideshow_dynamic_timeout_3.patch | 7.08 KB | drclaw |
#1 | views_slideshow_dynamic_timeout_2.patch | 7.47 KB | drclaw |
views_slideshow_dynamic_timeout.patch | 7.29 KB | drclaw | |
Comments
Comment #1
drclaw CreditAttribution: drclaw commentedSorry, made a little '#states' mistake in that last one. This one is better. Sorry!
Comment #2
drclaw CreditAttribution: drclaw commentedApparently I've never used states before. Sorry, this one's better. =/
Comment #3
drclaw CreditAttribution: drclaw commentedAny thoughts on this? No Rush, just wondering because right now my module's hacked and it would be good to know if you'll even consider this... =)
Thanks!
Comment #4
GreenSkunkHello @drclaw thank you for sharing. I saw your post on the Views_slideshow issue "Rotate after Video plays entirely".
I'm about to apply your latest patch but I have a question. Will the timeout default to the slideshow's default timeout when the "dynamic" timeout field is not set for the current slide?
Use case:
Site uses Views Slideshow to display County events and activities in Full Screen (actually scalable by width) as a digital billboard. Currently, is a slideshow of 1920x1080 images but have a request to add in video.
Slides display, by default, for over 10 seconds. This is important as we want maintainers to just add content and not worry about the duration. The view can use the video's Duration field.
So I'll be trying this out today and I'll report back!
Comment #5
GreenSkunkBad News: Well, since this slideshow is using Drupal 7 I tried out the Media Module (does not provide video durations) and not using the Embedded Video Module (has a duration field for videos(those video hosts that do)). Maybe I'll switch the setup if my current implementation does not fit. The Media module is nice though as it allows your users to either upload a video OR select a video from the web (using the various media module add-ons, like media_youtube and media_vimeo).
Great News: Your patch works @drclaw!
I added a Slide Duration field that is a date field that collects Minutes and Seconds for maintainers to use. Using a time field makes it easy for anyone to enter a video's duration instead of in milliseconds.
Modified the patch for the theme/views_slideshow_cycle.theme.inc to turn the time field into milliseconds. dpm() functions left in there for people to test their slideshows with.
Now, on to formatting the video so that it scales and playing upon loading of a slide!
Comment #6
Tyera CreditAttribution: Tyera commentedI just tested this patch, and it works great for me! Thank you so much, drclaw.
How could I set a default timeout to apply if the Timeout Field is blank?
Comment #7
drclaw CreditAttribution: drclaw commentedThe patch would probably have to be modified for a default value to be configured through Views Slideshow. However, you could add a default value to the field itself through the Field UI instead. This could work as an interim solution...
Comment #8
GreenSkunkI'm sorry but I missed those responses. It is still working great!
To get a default_timeout for empty timeout fields please refer to the modifications I made in #5.
After applying the modifications in #5 you can simply just use the Views Slideshow's Timer Delay:
To set a default timeout simply do the following in your View's Slideshow Settings (screenshot attached):
Thank you @drclaw for the dynamic timeout patches!
Comment #9
amara84 CreditAttribution: amara84 commentedHello @drclaw and @GreenSkunk,
I'm am quite new into Drupal7, so I apologize in advanced if my question sounds stupid.
I was wondering in which file of the view slideshow we have to copy and paste the patch?
Many thanks
Comment #10
NickDickinsonWildeneeds re-roll and testing, may get to it sometime.
Comment #11
Neslee Canil Pinto