I'd like to be able to show just the thumbnail image without any javascript applied to it where if you click the popup window comes up. Ideally I'd like a variable that I can put in the teaser template that will make just the plain thumbnail show up. Because I want to apply a link to a node on that thumbnail. Is it possible to do this?

Comments

stefano73’s picture

Status: Active » Fixed

You can override the function theme_node_images_view() by adding a function phptemplate_node_images_view() in your theme's template.php.

archard’s picture

Thanks, but I just found this node http://drupal.org/node/154066

This code works perfectly to grab the path for the image right out of the database

//use with node_images.module
//displays node images from the current node
if ( arg(0) == 'node' && is_numeric(arg(1)) && ! arg(2) ) {
  $node = node_load(arg(1));//get node id
  $max = variable_get('block_images', 3); //set the number of images to display
  $sql = db_query('SELECT * FROM {node_images} WHERE nid=%d AND status=1 ORDER BY weight', $node->nid);
  while (($data = db_fetch_object($sql)) && ($count < $max)) {
      $alt = $data->description;//use description as image alt text
      $output = theme("image", $data->filepath, $alt);
      $count++;
      print ($output);
  }
}

You can change $data->filepath to $data->thumbpath to get the thumbnail. And if its not for a block you can just cut out the statements that look for the node id.

stefano73’s picture

Status: Fixed » Closed (fixed)