Hello,
Very nice work. I'm working on a conversion from D5 to D6. I am using two imagecache presets that migrated from D5. One provides 150px scaling for thumbnails for use in teaser views, and the other provides 400px scaling for use in node displays.
Imagefield supports different imagecache presets for teaser and node display. As an example, I used the thumbnail preset with link to node for teaser views, and the display preset with no link for node views.
It seems that with filefield_image I can only choose to display or not display a given image file (with or without transformation) in teaser and node views. I can't choose different presets for the different views.
I found that I can work around this issue by creating two image fields, one for the teaser and the other for node views, and enabling them appropriately. So the field image1 enables the thumbnail preset and displays in teaser view. Image1 is hidden in node views. Similarly, the field image2 enables the display preset (400px) and appears in node views. Image2 is hidden in teaser views. Alt text works with both views. As a bonus, I downloaded your cvs change have have node links working with the thumbnail preset.
Everything is working, and the only downside to this approach is that I have to upload and store all of the image files twice. Should I continue down this path, or is there a better way? Thanks.
Comments
Comment #1
jpetso commentedDuplicate of #279288: There should be per context formatters for FileField: Teaser, Full Node, RSS.
Comment #2
awolfe commentedThanks! I figured I wasn't the first to notice this issue, but missed that in my searches. Guess I can go forward with duplicate images for now, and plan to upgrade this part of the site later. No worries. I can help with some testing if that's of any use.
Comment #3
YaxBalamAhaw commentedUmm, how exactly do you get the image into the teaser? Under the CCK Display Field settings I only get a choice of "Dynamic file formatter" (I have no idea what that means), and "". The images show up in the body but not the teaser. I even tried using Contemplate to get the image with "
print $node->field_image[0]['view']" but that showed nothing at all. Sorry, I'm a Drupal noob, can anyone tell me how I would display an image in the teaser?Comment #4
awolfe commentedNo coding necessary using CCK, imagecache, imageapi, filefield, and filefield_image. Within CCK, I basically have all modules enabled.
My basic recipe is:
Drupaltherapy has a great screencast for using CCK, imagecache and imagefield in this basic manner in D5. Filefield and filefield_image currently work a bit differently than the screencast in D6. However, this should put you on the right path:
http://www.drupaltherapy.com/node/47
Hope this helps.
Comment #5
mariusooms commentedI must be missing something. The only two option I get on the dropdowns under the Display Fields tab are "Dynamic file formatters" and "". Shouldn't I be seeing some other presets there?
Regards,
Marius