Project:Teaser Thumbnail
Version:6.x-1.4
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I see that you use alt and title on your blog http://teddy.fr/blog. How can I do that ?

Comments

#1

I tried to use phptemplate_teaserthumbnail_thumbnail but with no success.

I used $thumbnail = theme('imagecache', $preset, $thumbnail, $node->title, $node->title, $attributes); but node->title it's empty.

I'm using the teaserthumbnail in views. Like here http://www.usgirl.org/american-girls

Any ideas?

#2

Still talking alone...
I find a minor workaround :

        if (empty($this->options['preset'])) {
          $node->teaserthumbnail = $thumbnail;
          $node->type = $values->type;
          $thumbnail = theme('teaserthumbnail_thumbnail', $node);
        }
        else {
  $node2 = node_load($values->nid); // <-here
          $thumbnail = theme('imagecache', $this->options['preset'], $thumbnail, $node2->title, $node2->title, $attributes); //<-here
        }

It's messy I know and works only if you setup options['preset'] in views.

#3

Status:active» closed (fixed)

You could easily add the following function to your template.php file in your theme:

function phptemplate_teaserthumbnail_thumbnail($node, $attributes = NULL) {
  $thumbnail = $node->teaserthumbnail;

  // We define if we prepend a thumbnail to the teaser
  if (!empty($thumbnail)) {
    $preset = variable_get('teaserthumbnail_preset_'. $node->type, '');
    $preset = empty($preset) ? variable_get('teaserthumbnail_preset', '') : $preset ;
    $thumbnail = theme('imagecache', $preset, $thumbnail, $node->title, $node->title, $attributes);
  }
 
  return $thumbnail;
}

In the latest version of Teaser Thumbnail I have added "Thumbnail" as the default alt attribute and $node->title as the default title attribute.