Simple image gallery using imagefield and javascript
Submitted by edex on Fri, 06/06/2008 - 06:32.
Step 1: Copy "thumbnailviewer2.js" into js folder inside theme
Setp 2: Add code below inside template.php for that theme
drupal_add_js(drupal_get_path('theme', 'tapestry') . '/js/thumbnailviewer2.js', 'theme');
Step 3: Modify code below as needed and paste it it inside node.tpl.php
<?php if ($node->field_photo[0]['view']): ?>
<a href="<?php print base_path() ?>files/imagecache/featured/<?php print $node->field_photo[0]['filepath'] ?>" rel="enlargeimage::click" rev="loadarea"><?php print theme('imagecache', 'featuredsmall', $node->field_photo[0]['filepath'], $alt = $node->field_photo[0]['alt'], $title = $node->field_photo[0]['title']) ?></a>
<?php endif; ?>
<?php if ($node->field_photo[1]['view']): ?>
<a href="<?php print base_path() ?>files/imagecache/featured/<?php print $node->field_photo[1]['filepath'] ?>" rel="enlargeimage::click" rev="loadarea"><?php print theme('imagecache', 'featuredsmall', $node->field_photo[1]['filepath'], $alt = $node->field_photo[1]['alt'], $title = $node->field_photo[1]['title']) ?></a>
<?php endif; ?>
<?php if ($node->field_photo[2]['view']): ?>
<a href="<?php print base_path() ?>files/imagecache/featured/<?php print $node->field_photo[2]['filepath'] ?>" rel="enlargeimage::click" rev="loadarea"><?php print theme('imagecache', 'featuredsmall', $node->field_photo[2]['filepath'], $alt = $node->field_photo[2]['alt'], $title = $node->field_photo[2]['title']) ?></a>
<?php endif; ?>
<div id="loadarea" style="width: 550px"><?php print theme('imagecache', 'featured', $node->field_photo[0]['filepath'], $alt = $node->field_photo[0]['alt'], $title = $node->field_photo[0]['title']) ?></div>Source
Tags:

Post new comment