Thanks for your response.

Realize this has been asked before but I apply the patches listed in this thread by Drewish ( http://drupal.org/node/295896) and they fail--presume because patches are for an earlier Filefield version? Unless I'm patching wrong) "diff -u -p -r1.6 filefield_field.inc"

Is there an updated patch I can use to allow my image descriptions to appear in my nodes?

I'm attempting something similar to this poster: http://drupal.org/node/313635 (simply, adding a caption to each of my added images--either single imagefields or multiple)

In either case, however, I can't make my description visible. I know quicksketch has said he's responded to many inquiries about this and I realize Filefield on top of Imagefield messes up the Description text area from showing up on the node... but i can't find any solutions as of yet after searching rigorously... while I still see others doing it just fine without adding any patches or having any problems: http://drupal.org/node/672128 (see MELWYN: "i am using & activated both the imagecache and imagefield module and i have a description field below each image")

Thanks for any help.

Comments

quicksketch’s picture

You need to override ImageField's output to show the description. To do this, follow the same pattern as you would for all theming in Drupal.

- Open imagefield.module, find the function that begins with "theme_" that you want to override (in this case it's theme_imagefield_item).
- Copy/paste that function into your theme's template.php file.
- Rename the function from "theme_" to "yourtheme_" (replacing with the name of your theme).
- Make changes to the function.
- Clear your Drupal caches at admin/settings/performance.

Ultimately you just need to paste this into template.php and clear your caches:

function yourtheme_imagefield_item($item) {
  $output = ''
  $output .= theme('imagefield_image', $item, $item['alt'], $item['title']);
  $output .= $item['description'];
  return $output;
}

Note you'll need to change "yourtheme" to the name of your theme. You may also want to add a wrapper DIV around the whole thing so that you can center the caption (description) text.

One last note: the "description" field has been removed in Drupal 7, so while this will work for the time being, it's a dead-end path when you upgrade to Drupal 7 and will likely be lost in the upgrade.

calefilm’s picture

Awesome response. Thank you. BUT, what will I do in Drupal 7? Will we be able to add an image and edit a caption that will automatically appear below or above the image? This seems like such a fundamental element when adding an image.

I'm still lost as to why the description isn't automatically visible....

This guy seems to have it working fine without any theming:
Melwyn: "i am using & activated both the imagecache and imagefield module and i have a description field below each image" ( http://drupal.org/node/672128 )

Alan D.’s picture

Check out Custom Formatters, http://drupal.org/project/custom_formatters

This allows you to define your display formatter without any templates or programming, just simple to use tokens and HTML. Integrates with a number of related modules too.

calefilm’s picture

Thanks Alan! Appreciate your help :)

quicksketch’s picture

Status: Active » Fixed

I'm still lost as to why the description isn't automatically visible....

Description isn't visible because it was an accidental side-effect of building ImageField on top of FileField. Description was never meant to exist on ImageFields, just that by the time ImageField stabilized in Drupal 6, there were already thousands of sites using it. Description didn't exist in D5, and finally we got it fixed again in D7. While I'm not sure how it would be possible, my guess is that ImageField Extended will find a way to add additional information in a clean manner in Drupal 7.

Marking this request fixed, since it sounds like it's been answered two ways.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Marko B’s picture

How can custom formaters help this issue?

Alan D.’s picture

FileField, ImageField and ImageField extended supply tokens that the Token module uses. The custom formatter module allows you to use these tokens to generate your own formatters. I have only used this to test the ImageField Extended tokens, but it is fairly simple process from memory.

Marko B’s picture

Understood, i'll give it a go :-) thanx