Is it possible to shuffle the order of the thumbnail images?

I want to show different images in a Galleria on my front page each time a visitor comes to the site. I could have 50 images in my Galleria but only show 10. If I could shuffle the order of the images this would achieve the effect I want.

Is it possible to achieve what i want and is this the way to do it? I think what ive described would work if the thumbnails were being shown in a View.
Thanks

Comments

Peter Bex’s picture

You could try writing a bit of custom JS to shuffle the thumbnails, and load that in your theme's script[] section.

There's also a theme hook called theme_item_list which galleria calls to render the thumbs list. You could hook that in your theme's template.php file, and if the class attribute matches the string "galleria clear-block" you shuffle the items. Then you just call theme_item_list to let it render the way it would without your theme. Something like this (I didn't test it, use at your own risk, blahblah etc etc):

function phptemplate_item_list($items = array(), $title = NULL, $type = 'ul', $attributes = NULL) {
  if ($attributes['class'] == 'galleria clear-block')
    shuffle($items);
  return theme_item_list($items, $title, $type, $attributes);
}

You mentioned views would make this easier. Perhaps the views_galleria module suits your needs better.

jdln’s picture

thanks

Peter Bex’s picture

Status: Active » Closed (works as designed)

I assume this answers your question then? I'm closing the ticket.