I am using 4.6, with the image module.

I noticed that the Image Gallery that is created uses HTML like this:

<span class="image thumbnail">...

But the only CSS files included: misc/drupal.css and modules/image/image.css, and the theme related CSS, do not have any definition for that class.

Is this a bug?

-[edit note: sepeck] added code tags for the example to show

Comments

matbintang’s picture

Well, close to that. I actually want to try and change the theme of the image gallery. I noticed that the images in the gallery node has a class called "image thumbnail". I tried to define a class in my style sheet but no luck. Does CSS allow spaces?

Bèr Kessels’s picture

Simply because the default does not use it, it does not mean its a bug :). Other themes might use it, still.

berub@penelope:~/repository/contributions-4-6/modules/image$ grep -n 'thumbnail' image.module
12:      return t('An image (with thumbnail). This is ideal for publishing photographs or screenshots.');
80:  $size_group .= form_item(NULL, theme('table', $header , $rows), t('Select various pixel dimensions, "thumbnail" and "preview" are required.'));
183:      if ($size['label'] && !in_array($size['label'], array('thumbnail', '_original'))) {
222:            $block['content'] = l(image_display($images[0], 'thumbnail'), 'node/'.$images[0]->nid, array(), NULL, NULL, FALSE, TRUE);
227:            $block['content'] = l(image_display($images[0], 'thumbnail'), 'node/'.$images[0]->nid, array(), NULL, NULL, FALSE, TRUE);
252:  if ($node->images['thumbnail']) {
253:    $output.= form_item(t('Thumbnail'), image_display($node, 'thumbnail'));
288:  $node->teaser = l(image_display($node, 'thumbnail'), 'node/'.$node->nid, array(), NULL, NULL, FALSE, TRUE) . $node->teaser;
303:  if (empty($node->images['thumbnail'])) {
304:    $node->images['thumbnail'] = $node->images['_original'];
366: * (e.g. image/view/25/thumbnail or image/view/14)
501:  // We'll add height to keep thumbnails lined up.
502:  $size = _image_get_dimensions('thumbnail');
511:      $content.= l(image_display($gallery->latest, 'thumbnail'), 'image/tid/'.$gallery->tid, array(), NULL, NULL, FALSE, TRUE);
533:      $content .= l(image_display($image, 'thumbnail'), 'node/'.$image->nid, array(), NULL, NULL, FALSE, TRUE);
649:  return variable_get('image_sizes', array(array('widt

In other words: its all over the place. But have a closer look at the function image_display().

In any case: if you want to chnage this behaviour, you should do so in yor theme. Read more on 'theme functions' for this.
---
if you dont like the choices being made for you, you should start making your own.
---
[Bèr Kessels | Drupal services www.webschuur.com]

LGomez’s picture

Isn't that how it goes to the source-code? But where is it defined, so I can change the alignment of just the thumbnails that appear on my page?

naught101’s picture

if you're editing your theme, you can use ".thumbnail" in the theme's CSS. needs a bit of playing around to get it to work though.

dublin drupaller’s picture

Hi Bwooster47,

In case you haven't worked it out yet, I needed to change the layout of the thumbnails earlier and did it by...

  1. go to your /modules/image/ folder and open image.css in a text or style sheet editor
  2. add the following line to the end of image.css and edit accordingly.
.thumbnail img{ margin: .1em;padding-left:5px;padding-right:5px;padding-bottom:5px;padding-top:5px;background:white;border:1px solid #eaeaea;text-align:center;}

(the above style put a subtle, flickr.com-style, box around the mages)

Not sure if that's precisely what you were asking..but that did the trick for me. It gives me total control how thumbnails are displayed on the image gallery thumbnail pages.

There are some hard-coded styles in the image.module, such as the forced +75 pixel addition to the height of the thumbnails, but the style sheet should offer a lot of control for you.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

bwooster47’s picture

Code examples always help, thanks everyone!