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...

CommentFileSizeAuthor
#5 650676-counter-1.patch1 KBredndahead
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

endiku’s picture

Any 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.

ceerwk’s picture

I am also seeing this issue on nodes with just one image. Any follow on how to resolve this issue would be most appreciated.

coreyp_1’s picture

The 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 in views_slideshow/contrib/views_slideshow_singleframe/views_slideshow_singleframe.theme.inc.

Here's an example of how I did mine:

function YOURTHEMENAME_views_slideshow_singleframe_image_count($id, $view, $options) {
  $output = '<div class="views_slideshow_singleframe_image_count" id="views_slideshow_singleframe_image_count_' . $id . '"><span class="num">1</span> ' . t('of') .' <span class="total">1</span></div>';
  return $output;
}
redndahead’s picture

Priority: Normal » Critical

Marking as critical to look at before release.

redndahead’s picture

Status: Active » Fixed
FileSize
1 KB

This patch was committed. Thank you for the easy fix. Wish I had taken a look at this sooner.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.