Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
views_slideshow_cycle sets a function for after and before cycle plugin options that are in charge of updating active class for pager items when a current slide is changed.
So, if someone uses the advanced cycle plugin options this pager functionality is lost. User may add its own code to manage pager, but since I guess it's easier to just call those functions even when user suplies its own after and before code.
Patch attached in short.
Comment | File | Size | Author |
---|---|---|---|
#8 | views_slideshow-using-after-and-before-breaks-pager-1343416-8.patch | 5.28 KB | danlinn |
#4 | views_slideshow-after_befor_fn-1343416-4.patch | 5.24 KB | hkirsman |
#1 | after_befor_fn-1343416-1.patch | 10.42 KB | tunic |
Comments
Comment #1
tunicSolved by declaring functions with actual before and after code and calling them before call user code.
See attached patch.
My editor has removed of spaces from blank lines, so you patch has more changes than it should, but I guess it's ok.
Comment #2
juanramonperez CreditAttribution: juanramonperez commentedWorks for me. Thanks
Comment #3
RogerRogers CreditAttribution: RogerRogers commented#1 works for me. Thanks!! This is definitely needed, can't use before/after functions and pager without it.
Comment #4
hkirsman CreditAttribution: hkirsman commented#1 works.
Did a new patch for latest version. Also removed forwardFlag from user before and and after functions as pager_after_fn(curr, next, opts) and pager_before_fn(curr, next, opts) do not have fourth parameter.
Please fix this! Up since November 16, 2011! Took me some time to figure this out.
Comment #5
elBradford CreditAttribution: elBradford commentedI can confirm that #4 works on latest dev. PLEASE push this, thank you.
Comment #6
danlinn CreditAttribution: danlinn commentedI'll confirm #4 on the latest release again. Would be really nice to have this in at least the dev branch.
Comment #7
jojonaloha CreditAttribution: jojonaloha at Metal Toad commentedFrom what I can tell this patch breaks the active pager class being set on initial load and in autoplay. After applying the patch in #4 the active class is only set if I click on a pager item.
Comment #8
danlinn CreditAttribution: danlinn commentedHere's a new patch that fixes a few things: it will now resize slides if needed (context was being lost) and if the before or after function doesn't exist, it will still work properly.
Comment #9
jojonaloha CreditAttribution: jojonaloha at Metal Toad commentedI can confirm the patch in #8 resolves the issue I was seeing with active pagers.
Comment #10
inky@inky3d.com CreditAttribution: inky@inky3d.com commentedI have also used the patch and it works for me.
What doesn't work, though, is the "pauseOnPagerHover: 1"
I have set this through the views advanced options, and even tried 'hardcoding' it by setting it to 1 on jquery.cycle.all.js (line 1050).
Not sure if this is related, or if I should open a new issue?
Comment #11
raincloud CreditAttribution: raincloud commentedAfter updating views_slideshow_cycle.js as in solution #8, it works ok for me, but with side effects.
If I delete the custom "after" and "before" options (as specified in View->Slideshow->Settings->"jQuery Cycle Custom Options") from my View definition, or if I create a new View with Slideshow, the default Page Counter doesn't change when slide changes. But if those "before" and "after" options are specified in View definition then it's ok.
Comment #12
ermannob CreditAttribution: ermannob commentedPatch at #8 works for me. I had the "active pager" problem with a "before" advanced setting. Didn't notice any drawbacks yet.
Thanks.
Comment #13
wangqizhong CreditAttribution: wangqizhong commentedThanks a lot to tunic, hkirsman, danlinn and everyone else for the great work on the patches, testing, reviews and reporting.
It's more time this got committed and I went ahead and had this rolled at:
7.x-3.x: d01c839.
Marking this as fixed.
Please let me know if you would have any other questions, comments, issues or concerns on any of these changes, I would be glad to provide more information.
Thanks again to everyone for the help and great work on this issue.
Cheers!
Comment #15
ergophobe CreditAttribution: ergophobe commentedJust a note for those who might be stuck on Drupal 6 and having this problem, since this probably won't get backported, you can add something like this to your "after" callback.
Not great - it will have a lag time where the slide shows then a second later the pager catches up, but better than being broken.
Also of course you can get the pagerId some more general way if you want this to apply to all slideshows.