You are here

function theme_image_attach_attached_images_node in Image 6

Theme attached images shown in nodes.

Parameters

$nid: The attaching node's id.

$image_nodes: The node objects of the images to theme.

$img_size: The size at which to show images.

$teaser: Whether the $node is being shown as a teaser or not.

Override this in template.php to include a case statement if you want different node types to appear differently. If you have additional image sizes you defined in image.module, you can use them by theming this function as well.

1 theme call to theme_image_attach_attached_images_node()
image_attach_nodeapi in contrib/image_attach/image_attach.module
Implementation of hook_nodeapi().

File

contrib/image_attach/image_attach.module, line 688
image_attach.module

Code

function theme_image_attach_attached_images_node($nid, $image_nodes, $img_size, $teaser = FALSE) {
  drupal_add_css(drupal_get_path('module', 'image_attach') . '/image_attach.css');
  $options = array(
    'size' => $img_size,
    'link' => $teaser ? 'node' : 'image',
    'attributes' => array(
      'class' => 'image-attach-' . ($teaser ? 'teaser' : 'body'),
    ),
  );

  // We take the images in reverse order because they are floated to the right,
  // and we want the apparent left to right order to be correct.
  $output = theme('image_attach_attached_images', $nid, array_reverse($image_nodes), $options);

  // Wrap output of potentially multiple images in a DIV.
  if ($output && !$teaser) {
    $output = '<div class="all-attached-images">' . $output . '</div>';
  }
  return $output;
}