Is there any way to make the order of the slideshow random? So, instead of going from the first to the second to the third image, it would randomize the order.

I searched through the various Corporate Clean documentation and did not encounter a way to do it.

Thanks.

Comments

gtsopour’s picture

Assigned: Unassigned » gtsopour
Issue tags: +Corporate Clean Theme, +corporate clean, +Corporate Clean Slideshow

Hello mkinnan,

Could you please edit the template.php file under corporateclean theme and add the following option to the slideshow javascript
random: 1, // true for random, false for sequence (not applicable to shuffle fx)

Change from

/**
 * Add javascript files for jquery slideshow.
 */
if (theme_get_setting('slideshow_js','corporateclean')):

	drupal_add_js(drupal_get_path('theme', 'corporateclean') . '/js/jquery.cycle.all.min.js');
	
	//Initialize slideshow using theme settings
	$effect=theme_get_setting('slideshow_effect','corporateclean');
	$effect_time=theme_get_setting('slideshow_effect_time','corporateclean')*1000;
	
	//Defined the initial height (300) of slideshow and then the slideshow inherits the height of each slider item dynamically
	drupal_add_js('jQuery(document).ready(function($) {  
	
	$("#slideshow").cycle({
		fx:    "'.$effect.'",
		speed:  "slow",
		timeout: "'.$effect_time.'",
		pager:  "#slider-navigation",
		pagerAnchorBuilder: function(idx, slide) {
			return "#slider-navigation li:eq(" + (idx) + ") a";
		},
		height: 300,
		after: onAfter
	});
	
	function onAfter(curr, next, opts, fwd){
		var $ht = $(this).height();
		$(this).parent().animate({height: $ht});
	}
	
	});',
	array('type' => 'inline', 'scope' => 'header', 'weight' => 5)
	);

endif;

?>

To

/**
 * Add javascript files for jquery slideshow.
 */
if (theme_get_setting('slideshow_js','corporateclean')):

	drupal_add_js(drupal_get_path('theme', 'corporateclean') . '/js/jquery.cycle.all.min.js');
	
	//Initialize slideshow using theme settings
	$effect=theme_get_setting('slideshow_effect','corporateclean');
	$effect_time=theme_get_setting('slideshow_effect_time','corporateclean')*1000;
	
	//Defined the initial height (300) of slideshow and then the slideshow inherits the height of each slider item dynamically
	drupal_add_js('jQuery(document).ready(function($) {  
	
	$("#slideshow").cycle({
		fx:    "'.$effect.'",
		speed:  "slow",
		timeout: "'.$effect_time.'",
		pager:  "#slider-navigation",
		pagerAnchorBuilder: function(idx, slide) {
			return "#slider-navigation li:eq(" + (idx) + ") a";
		},
		height: 300,
                random: 1,
		after: onAfter
	});
	
	function onAfter(curr, next, opts, fwd){
		var $ht = $(this).height();
		$(this).parent().animate({height: $ht});
	}
	
	});',
	array('type' => 'inline', 'scope' => 'header', 'weight' => 5)
	);

endif;

?>

You can find the whole jQuery cycle plugin options here http://jquery.malsup.com/cycle/options.html
If this works for you, I will add an extra option inside Corporate Clean theme-settings. I'm looking forward to getting your answer

Thanks
/George

mkinnan’s picture

Thanks George. That did the trick.

gtsopour’s picture

Hello mkinnan,
thanks for your answer.

Next Corporate Clean release will have a theme-setting for this option.

Thanks
/George

gtsopour’s picture

Status: Active » Fixed

Added and committed the new theme-setting "Randomize slideshow order".

Thanks
/George

Status: Fixed » Closed (fixed)

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

jenniroe’s picture

Hi,
I'm new to drupal and this theme please could you tell me how i change the text on the slideshow please.
Thanks x