Fairly simple addon i've done in my theme layer, which (i think) could be done in the module, which would mean users get a better experience without javascript.

Currently, without JS you just get a list of thumbnails, however, if your using galleria, chances are you have a layout expecting a single large image as well. When the page loads without javascript you get an empty div, which if JS is enabled, is then populated with the 1st image in the list.

<div id="main-image"></div>

Trying to pre-populate it causes all sorts of problems, unless you then remove the pre-populated image before the javascript kicks in. My solution was fairly simple.


$vars['primary_photo'] = '<div id="main-image">';
$vars['primary_photo'] .= '<div class="nojs-galleria">' . theme_imagecache('large', $node->field_photos[0]['filepath'], $node->field_photos[0]['data']['title'], $node->field_photos[0]['data']['alt']) .'</div>';
$vars['primary_photo'] .= '</div>';
$vars['primary_photo'] .= '<script>$("div.nojs-galleria").remove();</script>';

This isn't a generic solution, but i expect it could be adapted fairly quickly so i thought i should share it.

a_c_m