Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | image_size.patch | 2.89 KB | NaheemSays |
image_size.patch | 2.1 KB | NaheemSays | |
Comments
Comment #1
jotarp CreditAttribution: jotarp commentedworks great !. Thanks.
Comment #2
MGN CreditAttribution: MGN commentedWith 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.Comment #3
NaheemSays CreditAttribution: NaheemSays commentedUpdated 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.
Comment #4
sunImage 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.
Comment #5
kaakuu CreditAttribution: kaakuu commentedThere 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.
Comment #6
NaheemSays CreditAttribution: NaheemSays commentedSince 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:
And that changes the image size from thumbnail to preview - just replace IMAGE_PREVIEW with whatever you want.
Comment #7
jiakomo CreditAttribution: jiakomo commentednbz,
your last post helped me a lot
Thanks :)