bug in field_slideshow.module

in lines 886 - 891

// Don't add controls if there's only one image
  if (count($variables['items']) == 1) {
    $variables['controls'] = '';
    $variables['pager'] = '';
  }
}

it should be:

if (count($variables['items']) == 1 && $variables['pager']['#pager'] != 'number') {
    $variables['controls'] = '';
    $variables['pager'] = '';
  }
}

Comments

idflood’s picture

Hi,

Thanks for reporting this issue. I'm not sure to understand why you would want controls and pager if there is only one image.

Can you explain your use case?

idflood’s picture

Title: field_slideshow.module » Hide controls and pager only if < 1 image and pager different than number?

Any news about why you would want this changed?

idflood’s picture

Status: Active » Postponed (maintainer needs more info)
dags’s picture

Issue summary: View changes

I came across a need to display the controls even if there is only 1 image. We inherited a legacy site where they had built a custom carousel plugin. We needed to make it responsive and Field Slideshow does that well out of the box. The existing pager was essentially providing a bottom border on the carousel. In most cases this bottom border contains actual pager controls but sometimes it's just empty. The simplest way for us to get it to work with the existing styles is to remove the lines in question in the original post. But it would be nice to have an option in the carousel settings to display the pager even though it may be empty.

screon’s picture

^ I agree with dags. Our lay-out breaks visually (not functionally) when a product only has 1 image and no thumbnails. Having this option would be nice.

ajits’s picture

Status: Postponed (maintainer needs more info) » Active

Working on it now.

  • AjitS committed 33828d0 on 7.x-2.x
    Issue #1636110: Hide controls and pager only  if...
ajits’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Fixed

Fixed in branch 7.x-2.x
Thank you for the code!

ajits’s picture

Category: Bug report » Feature request

This was not supposed to be considered as a bug. The module was intended to work that way.

ajits’s picture

Status: Fixed » Closed (fixed)

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

ckng’s picture

Status: Closed (fixed) » Needs work

This breaks existing site when upgrading from 7.x-1.x, where for one item in the pager, it was hidden. This should be available as an option to hide/show when there is only one item.

  • AjitS committed 33828d0 on 8.x-1.x
    Issue #1636110: Hide controls and pager only  if...
letrotteur’s picture

Agree with ckng. This shouldn't be default to show controls if there is only one image.

  • AjitS committed 33828d0 on 8.x-2.x
    Issue #1636110: Hide controls and pager only  if...
lamp5’s picture

Status: Needs work » Fixed
ajits’s picture

Status: Fixed » Closed (outdated)