Before I go tinkering with the CSS (and potentially making bigger mess of things) I thought I's ask if anybody knows why this is happening? When using the image gallery included with the Image module, a page of thumbs gets cluttered with the text. Perhaps I'm doing something wrong. Here' s an example. http://nh-vtx.com/image/tid/9

Can anyone help? Thanks in advance.
Wrath-BRIG-

Comments

btalon’s picture

subscribe

Lioz’s picture

looking at your code i see inline declaration for list items

<li style="height: 75px; width: 100px;">

this fixes item height hiding the text below
are you sure this code comes form image module?
adding inline style elements is not a good thing...

however try to delete the height delacaration and see what happens

XGI-Wrath’s picture

Thanks Lioz...

This site is new and I haven't customized any of the themes' or modules' code yet. I'll look around and see where the inline style is coming from. I too ams surprised to see it there. Thanks for the guidance, I'll post my findings.

-=w=-

XGI-Wrath’s picture

Found the following in image_gallery.module:

function theme_image_gallery_img($image, $size) {
  $width = $size['width'];
  // We'll add height to keep thumbnails lined up.
  $height = $size['height'] + 75;

  $content = '<li';
  if ($image->sticky) {
    $content .= ' class="sticky"';
  }
  $content .= " style='height : {$height}px; width : {$width}px;'>\n";
  $content .= l(image_display($image, IMAGE_THUMBNAIL), 'node/'. $image->nid, array('html' => TRUE));
  $content .= '<h3>'. l($image->title, 'node/'. $image->nid) .'</h3>';
  if (variable_get('image_gallery_node_info', 0)) {
    $content .= '<div class="author">'. t('Posted by: !name', array('!name' => theme('username', $image))) ."</div>\n";
    if ($image->created > 0) {
      $content .= '<div class="date">'. format_date($image->created) ."</div>\n";
    }
  }
  $content .= "</li>\n";

  return $content;
}

Commented out the following:
$content .= " style='height : {$height}px; width : {$width}px;'>\n";

Resulting in the following:

function theme_image_gallery_img($image, $size) {
  $width = $size['width'];
  // We'll add height to keep thumbnails lined up.
  $height = $size['height'] + 75;

  $content = '<li';
  if ($image->sticky) {
    $content .= ' class="sticky"';
  }
  /**
    *$content .= " style='height : {$height}px; width : {$width}px;'>\n";
    */
  $content .= l(image_display($image, IMAGE_THUMBNAIL), 'node/'. $image->nid, array('html' => TRUE));
  $content .= '<h3>'. l($image->title, 'node/'. $image->nid) .'</h3>';
  if (variable_get('image_gallery_node_info', 0)) {
    $content .= '<div class="author">'. t('Posted by: !name', array('!name' => theme('username', $image))) ."</div>\n";
    if ($image->created > 0) {
      $content .= '<div class="date">'. format_date($image->created) ."</div>\n";
    }
  }
  $content .= "</li>\n";

  return $content;
}

The galleries are no longer cluttered, but there is only one column of thumbnails. I was expecting more of a grid with multiple rows and columns, but with the font so large, it would be difficult. You've given a great start and I'm going to look at this some more. Thanks again for your help, it is at least usable now! :-)

-=w=-

metals83’s picture

@Wrath-BRIG It's an old post but thought it would be useful. You don't alter the module, these changes won't stay if you upgrade the module. So better approach is to copy the function theme_image_gallery_img to theme template,php file (if you don't have one create it !) rename the function to function phptemplate_image_gallery_img() and make all the changes that you want to. Remember to clear the cache at admin->settings->performance before you see the changes

Cheers
S

oadaeh’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

This issue is being closed because it is against a branch for a version of Drupal that is no longer supported.
If you feel that this issue is still valid, feel free to re-open and update it (and any possible patch) to work with the 7.x-4.x branch.
Thank you.