Hello!
Thank you for wonderful and continuously growing module !
I am trying to show 7 nodes using VSS. I set to show 5 items per slide.
So, i have 2 slides and 7 items(nodes) totaly.
When i enable the pager, i see that the number of "pager fields" is equal to the number of items (7). Instead, i expect that the number of "pager fields" has to be equal to the number of slides (2).
I've attached a drawing which can explain better my thoughts.

Is this a bug?
Once again thank you for great module!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

intyms’s picture

FileSize
2.45 KB

I remember that this function had been almost implemented in the ThumbnailHover.
Unfortunatly, i voted against this function here
I regret now because i see that it can be useful. The example of usage is shown in the header of this issue (pdf file).

I tried to play with the code of "views_slideshow.theme.inc".
Here is the patch against latest dev (28Feb).
I tested it.
It works both for:
a) Items_per_slide = 1 (all pager fields are displayed)
b) and for Items_per_slide>1 (the number of "pager fields" is equal to the number of slides)

intyms’s picture

Title: The number of "pager fields" is equal to the no. of items when we use "Item per Slide" settings » The number of "pager fields" is not equal to the number of slides when "Items per slide>1"
Status: Active » Needs review

changing title + status

intyms’s picture

Status: Needs review » Needs work
FileSize
96.16 KB

I think, it makes more sense, if the "pager field" will reflect the first item of every slide.
Thus the navigation will be more logical.

intyms’s picture

Status: Needs work » Needs review
FileSize
2.39 KB

here's the patch.
I forgot to mention that:
It works both for:
a) Items_per_slide = 1 (all pager fields are displayed)
b) and for Items_per_slide>1 (the number of "pager fields" is equal to the number of slides).

intyms’s picture

Some users may consider usefull the grouping of pager fields. Here is the patch for this.
The patch needs work. The active class doesn't assign to the pressed pager field. I don't know how to fix it.

A comparison of all 3 pathes is showing in the attached pdf.

I think both patches 2 and 3 are useful. It will be great if the user can choose which pager behavior to use.
So, it will be wonderful to have a dropdown box on the slideshow configuration page.
Redndahead, what do you think about this?

I don't have any experience on views customization, so it will take a long time to implement such feature by myself.

camdarley’s picture

The patch seems to work on 7.x version, but active/odd/even styles doesn't work anymore. Maybe conflict with function template_preprocess_views_slideshow_pager_field_item()

intyms’s picture

If you use the patch "1075844-intyms-01.patch" then the styles are working fine.
Instead, the patches "...-02" and "...-03" break the styles.

Regarding "-02 patch". Attached is a new one. Apply it to latest dev from 28Feb. It fixes the active class problem.

intyms’s picture

here is a new "...-03" patch (grouping of pagers). It seems to fix the style problem.

intyms’s picture

At this step we have 4 possible pager behaviors.
First behavior is provided by the current dev.
Other 3 behaviors are provided by the patches 01, 02 and 03.
I don't know which behaviour can satisfy the majority of users.
Also, maybe the "views slideshow" maintainers have other preferences regarding pagers.
I suggest to identify which variant (behaviour) is better.
Also, my coding style is bad because i am not a programer. Maybe somebody, more proffesional coder, can help to create patches.

intyms’s picture

dupplicate post

intyms’s picture

FileSize
193.32 KB

The attached pdf contains more information regarding pager behaviours mentioned above.
Let's discuss which one is better.

redndahead’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev

moving to 7 so I can find it easier

redndahead’s picture

Ok I've been looking at this and I would really, really like to implement this somehow. The one problem I have is it requires me to special case views_slideshow_cycle for the pager. I'm thinking the best thing to do is create another pager type that does the special casing.

What do you think?

intyms’s picture

Yes, i think, to create another pager type is good.
In this case, other modules will have a possibility to use it too. Am i right?

redndahead’s picture

Well other modules that utilize the grouping feature we offer in views slideshow cycle. Because really the code will have to check for that feature and then work accordingly.

redndahead’s picture

Category: bug » feature
Status: Needs review » Needs work

bumping to needs work and to feature request. If someone wants to create a patch that adds a new pager type to views slideshow cycle that supports grouping that would be great.

kgthompson’s picture

I came up with the following patch based on the work in #8. It handles the active class correctly for me. Note that I am using 6.x

redndahead’s picture

I would prefer that this is handled in views slideshow cycle instead of views slideshow

goldlilys’s picture

Subscribing, this is exactly what I need.

I want to display 4 content nodes at a time, but for the views slideshow to transition along with the pager for views. Currently, it's only working when I set at least 8 on views items pager, but if there's more than 8, the views slideshow doesn't go to the rest of the items like how the views pager does it. Please how to fix this bug?

lee20’s picture

I was having issues with the pager using Items per slide > 1 as well (7.x). I disabled the pager, added the json2 library and used that to set the pager selector and I added the slider html element to the view footer I added to the footer. This works for number based paging so I thought I'd share.

patoshi’s picture

hi Lee20,

can you show us what you did? a screenshot would be great!

thanks

lee20’s picture

@duckx - I have since had to switch to the jcarousel plugin for other reasons so I can't grab a screenshot. But to better describe what I did.. After adding the json2 library you have more options where you can manually set options for the cycle plugin.

I used that ability to set the "pager" option: eg.
{pager: '#my-pager-id'}

From there, I added the element for the pager in the views' footer. Eg:
<div id="my-pager-id"></div>

patoshi’s picture

confirmed working.. thanks! .. basically what you need to do is create an empty div container with an ID. then in the slideshow advanced settings area you designate which container to populate the pager in.

NIKS_Artreaktor’s picture

Hello everyone.

#22
Posted by lee20 - didnt understood how it work. Please explain more detailed if you can.

I solved this problem!

in post #17 Posted by PadreHomer - there was a patch file, but for D6

I changed it a little and it already works for D7

I used 7.x-3.x-dev 2012-Apr-25

File views_slideshow.theme.inc

From line 232-285


// Add our class to the wrapper.
  $vars['classes_array'][] = 'views_slideshow_pager_field';

//begin - ADD THIS CODE ++++++++

   $view = $vars['view'];
  
  $styles = '';
  if (isset($view->display_handler->display->display_options['style_options']['views_slideshow_cycle'])) {
    $styles = $view->display_handler->display->display_options['style_options']['views_slideshow_cycle'];
  }
  
  $styles_default = '';
  if (isset($view->display['default']->display_options['style_options']['views_slideshow_cycle'])) {
    $styles_default = $view->display['default']->display_options['style_options']['views_slideshow_cycle'];
  }
  // Retrive the number of items per frame
  if (isset($styles['items_per_slide']) && $styles['items_per_slide'] > 0) {
    $items_per_slide = $styles['items_per_slide'];
  }
  elseif (isset($styles_default['items_per_slide']) && $styles_default['items_per_slide'] > 0) {
    $items_per_slide = $styles_default['items_per_slide'];
  }
  else {
    $items_per_slide = 1;
  }

//end - ADD THIS CODE ++++++++  
  
  // Render all the fields unless there is only 1 slide and the user specified
  // to hide them when there is only one slide.
  $vars['rendered_field_items'] = '';
  if (empty($vars['settings']['hide_on_single_slide']) || count($vars['view']->result) > 1) {
    foreach ($vars['view']->result as $count => $node) {
      $rendered_fields = '';
      foreach ($vars['settings']['views_slideshow_pager_fields_fields'] as $field => $use) {
        if ($use !== 0 && is_object($vars['view']->field[$field])) {
          $rendered_fields .= theme(views_theme_functions('views_slideshow_pager_field_field', $vars['view'], $vars['view']->display[$vars['view']->current_display]), array('view' => $vars['view'], 'field' => $field, 'count' => $count));
        }
      }

//begin - ADD THIS CODE ++++++++

	  if($items_per_slide > 1) {
      if(!isset($altcount)) { 
        $altcount = 0;
      }
      if($count % $items_per_slide == 0) {
        $vars['rendered_field_items'] .= theme(views_theme_functions('views_slideshow_pager_field_item', $vars['view'], $vars['view']->display[$vars['view']->current_display]), array('vss_id' => $vars['vss_id'], 'item' => $rendered_fields, 'count' => $altcount, 'location' => $vars['location']));
        $altcount++;
      }
    } else {
      $vars['rendered_field_items'] .= theme(views_theme_functions('views_slideshow_pager_field_item', $vars['view'], $vars['view']->display[$vars['view']->current_display]), array('vss_id' => $vars['vss_id'], 'item' => $rendered_fields, 'count' => $count, 'location' => $vars['location']));
    }

//end - ADD THIS CODE ++++++++	  


//begin - DELETE or comment THIS CODE ------
	  
 //     $vars['rendered_field_items'] .= theme(views_theme_functions('views_slideshow_pager_field_item', $vars['view'], $vars['view']->display[$vars['view']->current_display]), array('vss_id' => $vars['vss_id'], 'item' => $rendered_fields, 'count' => $count, 'location' => $vars['location']));
	
//end - DELETE or comment THIS CODE ------    
	
    }
  }
}
Ace Cooper’s picture

The idea behind Patch #3 is the way to go for a numbered pager.

Thanks a lot, NIKS_Artreaktor, I added your code from #24 and the pager with multiple items per slide works like a charm.
I didn't select any fields for the pager, just added some CSS for the empty pager markup to show up - http://i.imgur.com/9MBYh.jpg

Required CSS (not final, just to make pager visible in Chrome):

.views-slideshow-controls-bottom { text-align: center; margin: 10px auto; }

.views-slideshow-pager-field-item {
  display: inline-block;
  background-color: rgba(0, 0, 0, 0.4);
  height: 18px; width: 18px;
  text-decoration: none;
  -moz-border-radius: 9px;
  -webkit-border-radius: 9px;
  border-radius: 9px;
  margin: 0 5px;
  cursor: pointer; }

.views-slideshow-pager-field-item.active { background-color: #000; }
JonMcL’s picture

Code from #24 worked out great for me (field pager, with no fields).

I rolled NIKS_Artreaktor's code as a patch. I'm not necessarily skilled in the ways of making patch, so please let me know if this needs fixes.

jnettik’s picture

I tested out the code in #24 and it worked for me as well. Thank you.

georgemastro’s picture

#26 didn't work for me so I made a new one.

jnettik’s picture

FileSize
7.06 KB

So after using the code in #24 for a bit I did run across a couple issues. The pager number was correct but if you added a page counter the number was off. Also, if you used the options "Hide pager if there is only one slide" and "Hide controls if there is only one slide", it breaks as it's still counting based off of the number of rows and not slides.

I attached a patch based off the code in #24 that addresses all these issues for me.

jnettik’s picture

Status: Needs work » Needs review
patty.fresonke’s picture

Used the patch in #29 and it worked like a charm! Thanks!

EDIT:
Just noticed that my 'active' pager isn't working properly...
Slider page 1 the proper pager is highlighted
Slider page 2 nothing is highlighted

EDIT: (again)
So something must be missing between #24 and #29 because using #24 the pager works properly

jnettik’s picture

Looking more into this, the Items per Slide setting comes from views_slideshow_cycle and not the main views slideshow module. I think the theme overrides for that setting need to be accounted for in that module anyway.

jnettik’s picture

Ok so attached is an updated patch that changes the slide counter's total from being count($rows) to $slide_count, which is created in _views_slideshow_preprocess_views_slideshow_slide_counter. This lets views_slideshow_cycle change how that is calculated if the slideshow type is views_slideshow_cycle.

I'm also preprocessing the pager so that it stops rendering items after it hits the number of slides there is.

estoyausente’s picture

This last patch run perfectly. ¡Thanks! ;-)

jnettik’s picture

Status: Needs review » Reviewed & tested by the community

Marking this as RTBC. Hopefully we can get this committed.

BrendanP’s picture

#33 working for me. Thanks for the patch.

dankh’s picture

Patch #33 worked for me too, thank you ! This is a very important feature, please consider commit so we can follow at least the dev version.

flocondetoile’s picture

patch #33 works fine. Not committed yet ?
thanks

xiukun.zhou’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Commit: 9e2df93

Status: Fixed » Closed (fixed)

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