--- views_slideshow/contrib/views_slideshow_singleframe/views_slideshow_singleframe.theme.inc 2009-11-06 07:21:55.000000000 +0100 +++ views_slideshow/contrib/views_slideshow_singleframe/views_slideshow_singleframe.theme.inc 2009-11-12 16:25:39.000000000 +0100 @@ -50,11 +50,28 @@ function theme_views_slideshow_singlefra if (!$js) { drupal_add_js(drupal_get_path('module', 'views_slideshow') .'/js/jquery.cycle.all.min.js', 'module'); } + + //retrieve the number of items per frame + if (isset($view->display_handler->default_display->options["style_options"]["singleframe"]["items_per_slide"]) && $view->display_handler->default_display->options["style_options"]["singleframe"]["items_per_slide"] > 0) { + $items_per_slide = $view->display_handler->default_display->options["style_options"]["singleframe"]["items_per_slide"]; + } + else { + $items_per_slide = 1; + } $output = '
' . "\n"; - foreach ($rows as $count => $item) { - $output .= theme('views_slideshow_singleframe_no_display_teaser', $item, $id, $count); + $items = array(); + $slidecount = 0; + + for ($i = 0; $i < count($rows); $i++) { + $item = $rows[$i]; + $items[] = $item; + if (count($items) == $items_per_slide || $i == (count($rows)-1)) { + $slidecount++; + $output .= theme('views_slideshow_singleframe_no_display_teaser', $items, $id, $slidecount); + $items = array(); + } } $output .= "
\n\n"; return $output; @@ -63,21 +80,29 @@ function theme_views_slideshow_singlefra /** * The html that will be placed into the element in its turn during its frame. */ -function theme_views_slideshow_singleframe_no_display_teaser($item, $id, $count) { - $class = 'views_slideshow_singleframe_slide views_slideshow_slide'; - if ($count) { - $class .= ' views_slideshow_singleframe_hidden'; +function theme_views_slideshow_singleframe_no_display_teaser($items, $id, $count) { + $slideclass = 'views_slideshow_singleframe_slide'; + if ($slidecount > 1) { + $slideclass .= ' views_slideshow_singleframe_hidden'; } - if ($count % 2) { - $class .= ' views-row-even'; - } - else { - $class .= ' views-row-odd'; + $output = '
' . "\n "; + foreach ($items as $itemcount => $item) { + $itemclass = 'views-row views-row-' . $itemcount; + if (!$itemcount) { + $itemclass .= ' views-row-first'; + } + if ($itemcount % 2) { + $itemclass .= ' views-row-even'; + } + else { + $itemclass .= ' views-row-odd'; + } + $output .= '
' . "\n"; + $output .= $item . "\n"; + $output .= '
' . "\n"; } - $output = '
' . "\n "; - $output .= $item . "\n"; - $output .= '
' . "\n\n"; + $output .= '
' . "\n\n"; return $output; } --- views_slideshow/contrib/views_slideshow_singleframe/views_slideshow_singleframe.views_slideshow.inc 2009-10-05 06:41:09.000000000 +0200 +++ views_slideshow/contrib/views_slideshow_singleframe/views_slideshow_singleframe.views_slideshow.inc 2009-11-12 16:28:18.000000000 +0100 @@ -20,6 +20,7 @@ function views_slideshow_singleframe_vie 'sort' => array('default' => 1), 'effect' => array('default' => 'fade'), 'speed' => array('default' => 700), //normal + 'items_per_slide' => array('default' => 1), 'ie' => array( 'contains' => array( 'cleartype' => array('default' => TRUE), @@ -125,6 +126,12 @@ function views_slideshow_singleframe_vie '#default_value' => (isset($view->options['singleframe']['image_count'])) ? $view->options['singleframe']['image_count'] : 0, '#description' => t('Determine if the Image Counter (1 of 4) should be displayed and if so whether they should appear before or after the slideshow.'), ); + $form['singleframe']['items_per_slide'] = array( + '#type' => 'textfield', + '#title' => t('Items per slide'), + '#default_value' => (isset($view->options['singleframe']['items_per_slide'])) ? $view->options['singleframe']['items_per_slide'] : 2, + '#description' => t('The number of items per slide'), + ); $options = array( 'none' => 'none', 'blindX' => 'blindX',