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.
I have a view slideshow with a pager that was working fine up until I saw a view with only one node - the pager reads 'of' (as opposed to '1 of 1'). With more than 1 node, it correctly reads '1 of 2', etc.
Is this a bug? I tried looking through the code to see where this was being set, but couldn't quite pinpoint it...
Comment | File | Size | Author |
---|---|---|---|
#5 | 650676-counter-1.patch | 1 KB | redndahead |
Comments
Comment #1
endiku CreditAttribution: endiku commentedAny news on this? Having a similar if not the same issue. If only one item is in the view then the pager breaks down. In fact it also can break the display slightly. While multiple items makes it opperate just fine.
Comment #2
ceerwk CreditAttribution: ceerwk commentedI am also seeing this issue on nodes with just one image. Any follow on how to resolve this issue would be most appreciated.
Comment #3
coreyp_1 CreditAttribution: coreyp_1 commentedThe quick and dirty way around this would be to just override the theme function so that it is pre-populated with "1 of 1". If there are more pictures, then the javascript will override it to read "1 of 10" (for example).
The function to override is
theme_views_slideshow_singleframe_image_count()
found inviews_slideshow/contrib/views_slideshow_singleframe/views_slideshow_singleframe.theme.inc
.Here's an example of how I did mine:
Comment #4
redndahead CreditAttribution: redndahead commentedMarking as critical to look at before release.
Comment #5
redndahead CreditAttribution: redndahead commentedThis patch was committed. Thank you for the easy fix. Wish I had taken a look at this sooner.