Hi, IMO this is a much needed feature and while i have been using Image module for Drupal 6 for a few months, until now I manually edited it to show different image sizes for teasers.

The attached patch is a more complete approach adding a form on the content-type page giving a choice for sizes to use in the body and teaser (defaults being what the module currently does).

Code is a modified version of what is already in image_attach for other node types.

CommentFileSizeAuthor
#3 image_size.patch2.89 KBNaheemSays
image_size.patch2.1 KBNaheemSays
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jotarp’s picture

works great !. Thanks.

MGN’s picture

Status: Needs review » Needs work

With the patch, the links to select the image size ( image_link() ) no longer work - the image is always the size set on the content-type page. Thus this patch breaks normal functionality and needs work.

Also, in the copy-and-paste from the image_attach code it looks like you forgot to edit the description to omit the sentence: 'Hidden' will not show the image. That is not one of the options and wouldn't make sense for the image content type.

NaheemSays’s picture

Status: Needs work » Needs review
FileSize
2.89 KB

Updated patch fixing the mentioned issues:

You can select the sizes on the page, and also set default sizes per content type. The text about choosing hidden has also been removed.

sun’s picture

Status: Needs review » Closed (won't fix)

Image module will soon be a simple wrapper around ImageField providing a content-type. Since ImageFields, resp. CCK, already allow to configure the output for various node build modes, I'm marking this won't fix.

kaakuu’s picture

There are many users who use this module and will still be using as Drupal five and six for unforeseen long times. Imagefield has CCK dependency and other dependencies perhaps and all users may not need to actively use or install CCK.

NaheemSays’s picture

Since writing this patch, I have moved to a different approach that let me unhack image.module - theme overrides.

In my theme's template.php I added:

/**
 * Override the theme settings for image teasers.
 */

function phptemplate_image_teaser($node, $size) {
  return l(image_display($node, IMAGE_PREVIEW), 'node/'. $node->nid, array('html' => TRUE));
}

And that changes the image size from thumbnail to preview - just replace IMAGE_PREVIEW with whatever you want.

jiakomo’s picture

nbz,
your last post helped me a lot
Thanks :)